---------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  O:\returns\returns_REStat_replication_data_23082022.log
  log type:  text
 opened on:  23 Aug 2022, 13:46:05

. cd "W:\returns"
W:\returns

. global estimation "W:\returns"

. 
. do "returns_DATAPREP_1_CLEANED_2022_08_22"  // data creation

. clear all

. set more off

. *capture log close
. set logtype text

. set matsize 10000
set matsize ignored.
    Matrix sizes are no longer limited by c(matsize) in modern Statas.  Matrix sizes are now limited by flavor of Stata.  See limits
    for more details.

. set max_memory 120g

. 
. local mydate: di %tdDNCY date(c(current_date), "DMY")

. 
. global output           "O:\returns"

. *global data            "D:\ya244a\2016"                                // old FIONA path
. global data             "D:\ready-made\FLEED_TOTAL\2016"

. global work                     "W:" 

. global return_data      "W:\returns\estimation_data"

. global dofiles          "W:\data_prep" 

. global patent_data      "W:\data_prep\patent_data"

. global ptest_data       "W:\data_prep\P_tests"

. 
. 
. **************************************************************************************
. 
. * This file generates the data for the CEM matching for
. * Aghion, Akcigit, Hyytinen & Toivanen : 
. * A year older, a year wiser (and farther from the frontier):invention rents and human capital depreciation
. 
. **************************************************************************************
. 
. 
. 
. 
. ***************************************************************************************
. 
. *log using "${output}\returns_DATAPREP_1_CLEANED`mydate'.log" , replace
. /*  
> \
> ()
> {}
> []
> =
> `i'
>  >
>  <
>  |
> */
. 
. * run the auxiliary data preparation files
. 
. do "${dofiles}\inventors_patstat_11112015.do"

. clear all

. set more off

. *capture log close
. set logtype text

. set matsize 10000
set matsize ignored.
    Matrix sizes are no longer limited by c(matsize) in modern Statas.  Matrix sizes are now limited by flavor of Stata.  See limits
    for more details.

. 
. local mydate: di %tdDNCY date(c(current_date), "DMY")

. 
. *cd "X:"
. 
. global output   "O:\returns"

. global data             "D:" 

. global work             "W:" 

. 
. *log using "${output}\inventors_patstat_`mydate'.log" , replace
. /*  
> \
> ()
> {}
> []
> =
> `i'
>  >
>  <
>  &
>  |
> */
. 
. use "W:\data_prep\patent_data\patstat_19782013.dta"

. 
. * ADD: comparison of patents with and without known inventor
. 
. 
. drop if shtun == ""
(6,050 observations deleted)

. gen vuosi               = AppYear 

. destring vuosi, replace
vuosi: all characters numeric; replaced as int

. rename shtun shtun_lyh

. 
. bysort shtun vuosi: gen ind_id = _n

. 
. bysort shtun vuosi: gen pat_count_y = _N

. bysort shtun: gen pat_count_all = _N

. 
. * patent statistics
. * count of patents per inventor in a given year
. tab pat_count_y

pat_count_y |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     27,203       52.37       52.37
          2 |     10,454       20.12       72.49
          3 |      5,040        9.70       82.19
          4 |      3,048        5.87       88.06
          5 |      1,700        3.27       91.33
          6 |      1,248        2.40       93.73
          7 |        826        1.59       95.32
          8 |        504        0.97       96.29
          9 |        414        0.80       97.09
         10 |        290        0.56       97.65
         11 |        253        0.49       98.14
         12 |        180        0.35       98.48
         13 |        143        0.28       98.76
         14 |         84        0.16       98.92
         15 |        135        0.26       99.18
         16 |         80        0.15       99.33
         17 |         68        0.13       99.46
         18 |         18        0.03       99.50
         19 |         38        0.07       99.57
         20 |        100        0.19       99.77
         23 |         23        0.04       99.81
         31 |         31        0.06       99.87
         32 |         32        0.06       99.93
         36 |         36        0.07      100.00
------------+-----------------------------------
      Total |     51,948      100.00

. * count of patent per inventor overall
. tab pat_count_all 

pat_count_a |
         ll |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |      9,421       18.14       18.14
          2 |      6,344       12.21       30.35
          3 |      4,509        8.68       39.03
          4 |      3,432        6.61       45.63
          5 |      2,970        5.72       51.35
          6 |      2,130        4.10       55.45
          7 |      2,058        3.96       59.41
          8 |      1,864        3.59       63.00
          9 |      1,854        3.57       66.57
         10 |      1,390        2.68       69.25
         11 |      1,276        2.46       71.70
         12 |      1,212        2.33       74.04
         13 |        858        1.65       75.69
         14 |        742        1.43       77.12
         15 |        900        1.73       78.85
         16 |        832        1.60       80.45
         17 |        765        1.47       81.92
         18 |        558        1.07       83.00
         19 |        285        0.55       83.55
         20 |        500        0.96       84.51
         21 |        630        1.21       85.72
         22 |        220        0.42       86.14
         23 |        391        0.75       86.90
         24 |        360        0.69       87.59
         25 |        425        0.82       88.41
         26 |        234        0.45       88.86
         27 |        189        0.36       89.22
         28 |        140        0.27       89.49
         29 |        290        0.56       90.05
         30 |        210        0.40       90.45
         31 |        186        0.36       90.81
         32 |        128        0.25       91.06
         33 |        165        0.32       91.38
         34 |        272        0.52       91.90
         35 |        210        0.40       92.30
         36 |        216        0.42       92.72
         37 |        111        0.21       92.93
         38 |        228        0.44       93.37
         39 |         78        0.15       93.52
         41 |        123        0.24       93.76
         42 |        168        0.32       94.08
         43 |        215        0.41       94.50
         44 |         44        0.08       94.58
         45 |         90        0.17       94.75
         46 |        184        0.35       95.11
         48 |        192        0.37       95.48
         49 |         49        0.09       95.57
         50 |         50        0.10       95.67
         53 |         53        0.10       95.77
         54 |        108        0.21       95.98
         55 |         55        0.11       96.08
         56 |         56        0.11       96.19
         59 |        118        0.23       96.42
         60 |        120        0.23       96.65
         67 |        134        0.26       96.91
         68 |        136        0.26       97.17
         69 |         69        0.13       97.30
         70 |         70        0.13       97.44
         71 |         71        0.14       97.57
         73 |        146        0.28       97.86
         74 |        222        0.43       98.28
         76 |         76        0.15       98.43
         83 |         83        0.16       98.59
        115 |        230        0.44       99.03
        119 |        119        0.23       99.26
        120 |        120        0.23       99.49
        129 |        129        0.25       99.74
        135 |        135        0.26      100.00
------------+-----------------------------------
      Total |     51,948      100.00

. tab pat_count_all if ind_id == 1

pat_count_a |
         ll |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |      9,421       26.34       26.34
          2 |      5,438       15.21       41.55
          3 |      3,599       10.06       51.61
          4 |      2,532        7.08       58.70
          5 |      2,119        5.93       64.62
          6 |      1,451        4.06       68.68
          7 |      1,356        3.79       72.47
          8 |      1,161        3.25       75.72
          9 |      1,148        3.21       78.93
         10 |        806        2.25       81.18
         11 |        716        2.00       83.18
         12 |        704        1.97       85.15
         13 |        471        1.32       86.47
         14 |        388        1.08       87.55
         15 |        483        1.35       88.90
         16 |        423        1.18       90.09
         17 |        394        1.10       91.19
         18 |        258        0.72       91.91
         19 |        139        0.39       92.30
         20 |        247        0.69       92.99
         21 |        271        0.76       93.75
         22 |         91        0.25       94.00
         23 |        163        0.46       94.46
         24 |        161        0.45       94.91
         25 |        160        0.45       95.36
         26 |         86        0.24       95.60
         27 |         67        0.19       95.78
         28 |         46        0.13       95.91
         29 |        105        0.29       96.21
         30 |         74        0.21       96.41
         31 |         80        0.22       96.64
         32 |         44        0.12       96.76
         33 |         73        0.20       96.96
         34 |         82        0.23       97.19
         35 |         69        0.19       97.39
         36 |         65        0.18       97.57
         37 |         27        0.08       97.64
         38 |         73        0.20       97.85
         39 |         28        0.08       97.93
         41 |         30        0.08       98.01
         42 |         48        0.13       98.14
         43 |         51        0.14       98.29
         44 |         14        0.04       98.32
         45 |         27        0.08       98.40
         46 |         51        0.14       98.54
         48 |         54        0.15       98.69
         49 |         10        0.03       98.72
         50 |          9        0.03       98.75
         53 |         15        0.04       98.79
         54 |         29        0.08       98.87
         55 |         12        0.03       98.90
         56 |         21        0.06       98.96
         59 |         25        0.07       99.03
         60 |         24        0.07       99.10
         67 |         36        0.10       99.20
         68 |         30        0.08       99.28
         69 |         21        0.06       99.34
         70 |         17        0.05       99.39
         71 |         12        0.03       99.42
         73 |         33        0.09       99.52
         74 |         39        0.11       99.63
         76 |         20        0.06       99.68
         83 |         13        0.04       99.72
        115 |         29        0.08       99.80
        119 |         17        0.05       99.85
        120 |         14        0.04       99.89
        129 |         18        0.05       99.94
        135 |         23        0.06      100.00
------------+-----------------------------------
      Total |     35,761      100.00

. 
. bysort shtun vuosi: egen family_size_mean       = mean(family_size)
(2952 missing values generated)

. bysort shtun vuosi: egen family_size_min        = min(family_size)
(2952 missing values generated)

. bysort shtun vuosi: egen family_size_max        = max(family_size)
(2952 missing values generated)

. 
. bysort shtun vuosi: egen claims_mean            = mean(claims)
(2952 missing values generated)

. bysort shtun vuosi: egen claims_min             = min(claims)
(2952 missing values generated)

. bysort shtun vuosi: egen claims_max             = max(claims)
(2952 missing values generated)

. 
. bysort shtun vuosi: egen bwd_cits_tot           = total(bwd_cits)

. bysort shtun vuosi: egen bwd_cits_mean          = mean(bwd_cits)
(2952 missing values generated)

. bysort shtun vuosi: egen bwd_cits_min           = min(bwd_cits)
(2952 missing values generated)

. bysort shtun vuosi: egen bwd_cits_max           = max(bwd_cits)
(2952 missing values generated)

. 
. bysort shtun vuosi: egen fwd_cits5_tot          = total(fwd_cits5)

. bysort shtun vuosi: egen fwd_cits5_mean         = mean(fwd_cits5)
(2952 missing values generated)

. bysort shtun vuosi: egen fwd_cits5_min          = min(fwd_cits5)
(2952 missing values generated)

. bysort shtun vuosi: egen fwd_cits5_max          = max(fwd_cits5)
(2952 missing values generated)

. 
. * patent level desc stat
. tabstat family_size* claims* bwd_cits* fwd_cits5*, stat(mean sd p1 p25 p50 p75 p99 n)

   stats |  family~e  famil~an  famil~in  family~x    claims  claims~d  claim~an  claim~in  claims~x  bwd_cits  bwd_ci~t  bwd_c~an
---------+------------------------------------------------------------------------------------------------------------------------
    mean |  6.802661  6.772613  5.955405  7.628419  15.05288  4.335614  14.95846  12.30888  18.17765  4.546345   10.0031  4.552099
      sd |  4.293538  4.016949  3.875808   4.66969  11.49531  5.162603  10.33301  9.374837  14.40546  4.379636  16.02753  3.956712
      p1 |         1         1         1         1         0         0         0         0         0         0         0         0
     p25 |         4         4         3         5         8  1.428571         8         6         9         3         3         3
     p50 |         6         6         5         7        13         3      13.5        11        15         4         6         4
     p75 |         8         8         7        10        19  5.333333  19.55556        16        23         6        11       5.5
     p99 |        23        23        21        26        54      25.5        49        44        68        16        68  15.85714
       N |     48409     48996     48996     48996     48409     48409     48996     48996     48996     48409     51948     48996
----------------------------------------------------------------------------------------------------------------------------------

   stats |  bwd_c~in  bwd_ci~x  fwd_ci~5  fwd~5_xy  fwd_ci~t  fwd_c~an  fwd_c~in  fwd_ci~x
---------+--------------------------------------------------------------------------------
    mean |  3.658686  5.617295  .3951951  .2342953  .9052322  .3905472  .2290391  .6900767
      sd |   3.56883   5.61041  1.381663  .8265376  3.000582  1.186697  1.026118   1.91267
      p1 |         0         0         0         0         0         0         0         0
     p25 |         2         3         0         0         0         0         0         0
     p50 |         3         5         0         0         0         0         0         0
     p75 |         5         7         0         0         0         0         0         0
     p99 |        13        21         7         4        14       5.5         5        10
       N |     48996     48996     48409     48409     51948     48996     48996     48996
------------------------------------------------------------------------------------------

. 
. drop if ind_id > 1
(16,187 observations deleted)

. * inventor level patent desc stat
. tabstat family_size* claims* bwd_cits* fwd_cits5* pat_count*, stat(mean sd p1 p25 p50 p75 p99 n)

   stats |  family~e  famil~an  famil~in  family~x    claims  claims~d  claim~an  claim~in  claims~x  bwd_cits  bwd_ci~t  bwd_c~an
---------+------------------------------------------------------------------------------------------------------------------------
    mean |  6.733521  6.720558  6.389579  7.059521  14.42305  4.084092  14.37401  13.25175  15.63761  4.550156  6.154302  4.549009
      sd |  4.259939  4.142398  4.092868  4.424819  10.87214  4.861842  10.41234  9.993203  12.18552  4.001035  8.556783  3.847269
      p1 |         1         1         1         1         0         0         0         0         0         0         0         0
     p25 |         4         4         4         4         8       1.4         8         7         8         3         3         3
     p50 |         6         6         5         6        13      2.75        13        12        14         4         4         4
     p75 |         8         8         8         9        18         5  18.33333        17        20         6         7         6
     p99 |        23        23        23        24        53        24        50        48        58        15        32        15
       N |     33436     33585     33585     33585     33436     33436     33585     33585     33585     33436     35761     33585
----------------------------------------------------------------------------------------------------------------------------------

   stats |  bwd_c~in  bwd_ci~x  fwd_ci~5  fwd~5_xy  fwd_ci~t  fwd_c~an  fwd_c~in  fwd_ci~x  pat_co~y  pat_co~l
---------+----------------------------------------------------------------------------------------------------
    mean |  4.162781  4.979574   .379232  .2246082  .5349683  .3777692  .3027244  .4883132  1.452644  7.149716
      sd |    3.7093  4.563237   1.34385   .798855  1.946578  1.258584  1.183085  1.557838  1.202208  11.42592
      p1 |         0         0         0         0         0         0         0         0         1         1
     p25 |         2         3         0         0         0         0         0         0         1         1
     p50 |         4         4         0         0         0         0         0         0         1         3
     p75 |         5         6         0         0         0         0         0         0         1         8
     p99 |        14        16         7         4         9         6         6         8         6        59
       N |     33585     33585     33436     33436     35761     33585     33585     33585     35761     35761
--------------------------------------------------------------------------------------------------------------

. 
. keep shtun vuosi AppYear *_mean *_min *_max *_tot pat_count* syrtun_pat

. 
. *log close
. save "W:\data_prep\patent_data\patstat_all.dta", replace
file W:\data_prep\patent_data\patstat_all.dta saved

. exit

end of do-file

. 
. global output           "O:\returns"

. *global data            "D:\ya244a\2016"                                // old FIONA path
. global data             "D:\ready-made\FLEED_TOTAL\2016"

. global work                     "W:" 

. global return_data      "W:\returns\estimation_data"

. global dofiles          "W:\data_prep" 

. global patent_data      "W:\data_prep\patent_data"

. global ptest_data       "W:\data_prep\P_tests"

. 
. 
. use "${data}\fleed_kokonais_1988.dta"

. 
. keep if sukup == "1"
(1,809,466 observations deleted)

. 
. keep vuosi shnro* shtun* sukup ika kansa1 kieli suuralue kunta kuntaryhma maakunta ///
>      lvar svatva svatvp svelat telink tyotu tyrtu apvm1 apvm2 suorv yotutk ktutk ututku ///
>          amas1 amas2 ptoim1 ptoim2 saikavv sivs sose syrtun sykstun ///
>          toimiala toimiala2 lv_sykstun hk_sykstun ammattikoodi

.      
. forvalues i = 1989/1990 {
  2.          append using "${data}\fleed_kokonais_`i'.dta", ///
> 
  3. keep if sukup == "1"
  4. 
. keep vuosi shnro* shtun* sukup ika kansa1 kieli suuralue kunta kuntaryhma maakunta ///
>      lvar svatva svatvp svelat telink tyotu tyrtu apvm1 apvm2 suorv yotutk ktutk ututku ///
>          amas1 amas2 ptoim1 ptoim2 saikavv sivs sose syrtun sykstun ///
>          toimiala toimiala2 lv_sykstun hk_sykstun ammattikoodi
  5.         }
(note: variable lv_sykstun was long, now double to accommodate using data's values)
(1,813,601 observations deleted)
(note: variable sose was str1, now str2 to accommodate using data's values)
(note: variable ammattikoodi was str1, now str4 to accommodate using data's values)
(1,823,585 observations deleted)

. 
. * taxable wealth available 1991 - 2005.
. forvalues i = 1991/2004 {
  2.          append using "${data}\fleed_kokonais_`i'.dta", ///
> 
  3. keep if sukup == "1"
  4. 
. keep vuosi shnro* shtun* sukup ika kansa1 kieli suuralue kunta kuntaryhma maakunta  ///
>      lvar svatva svatvp svelat telink tyotu tyrtu apvm1 apvm2 suorv yotutk ktutk ututku ///
>          amas1 amas2 ptoim1 ptoim2 saikavv sivs sose syrtun sykstun ///
>          toimiala toimiala2 lv_sykstun hk_sykstun ammattikoodi lvar
  5.         }
(note: variable lvar was byte, now long to accommodate using data's values)
(note: variable svelat was byte, now long to accommodate using data's values)
(1,829,952 observations deleted)
(1,834,777 observations deleted)
(note: variable toimiala was str4, now str5 to accommodate using data's values)
(note: variable toimiala2 was str4, now str5 to accommodate using data's values)
(note: variable svatvp was byte, now long to accommodate using data's values)
(note: variable telink was byte, now long to accommodate using data's values)
(1,839,520 observations deleted)
(1,841,891 observations deleted)
(note: variable ammattikoodi was str4, now str5 to accommodate using data's values)
(1,845,084 observations deleted)
(1,847,918 observations deleted)
(note: variable ktutk was str5, now str6 to accommodate using data's values)
(1,852,567 observations deleted)
(1,858,034 observations deleted)
(1,861,387 observations deleted)
(1,862,970 observations deleted)
(1,864,972 observations deleted)
(1,867,783 observations deleted)
(1,873,145 observations deleted)
(1,880,387 observations deleted)

. * NOTE: apvm1 and apvm2 missing 2005-
.  
. forvalues i = 2005/2012 {
  2.          append using "${data}\fleed_kokonais_`i'.dta", ///
>          
  3. keep if sukup == "1"
  4. 
. keep vuosi shnro* shtun* sukup ika kansa1 kieli suuralue kunta kuntaryhma maakunta ///
>      lvar svatva svatvp svelat telink tyotu tyrtu apvm1 apvm2 suorv yotutk ktutk ututku ///
>          amas1 amas2 ptoim1 ptoim2 saikavv sivs sose syrtun sykstun ///
>          toimiala toimiala2 lv_sykstun hk_sykstun ammattikoodi
  5.         }
(1,888,172 observations deleted)
(1,895,934 observations deleted)
(1,905,225 observations deleted)
(1,912,926 observations deleted)
(1,919,800 observations deleted)
(1,924,100 observations deleted)
(1,932,555 observations deleted)
(1,932,198 observations deleted)

.                 
. *use "W:\fleed_88_12.dta", clear
. * check data for duplicate, drop duplicates
. duplicates tag shtun_lyh vuosi, gen(dupl_shtun_vuosi)

Duplicates in terms of shtun_lyh vuosi

. tab dupl_shtun_vuosi

dupl_shtun_ |
      vuosi |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 | 46,891,494      100.00      100.00
          1 |         18        0.00      100.00
          2 |         24        0.00      100.00
          3 |         16        0.00      100.00
------------+-----------------------------------
      Total | 46,891,552      100.00

. drop if dupl_shtun_vuosi > 0
(58 observations deleted)

. 
. * match inventors
. gen AppYear             = vuosi

. tostring AppYear, replace
AppYear was float now str4

. 
. *gen shtun                      = shtun_lyh
. 
. merge 1:m shtun_lyh vuosi using "${patent_data}\patstat_all.dta"

    Result                           # of obs.
    -----------------------------------------
    not matched                    46,865,081
        from master                46,860,407  (_merge==1)
        from using                      4,674  (_merge==2)

    matched                            31,087  (_merge==3)
    -----------------------------------------

. rename _merge merge_patstat

. 
. * drop those patents that are not matched
. drop if merge_patstat == 2
(4,674 observations deleted)

. * generate inventor dummy
. gen inv_1                       = 0

. replace inv_1           = 1 if merge_patstat == 3
(31,087 real changes made)

. 
. bysort shtun_lyh: egen inventor = max(inv_1)

. 
. replace pat_count_y = 0 if pat_count_y == .
(46,860,407 real changes made)

. 
. sort shtun_lyh vuosi

. bysort shtun_lyh: gen pat_count_cum             = sum(pat_count_y)

. 
. * deflate and form income variables
. * deflator
. * source: see 030_khi_tau_103.xlsx
. * 2014 = 1
. gen cpi                                 = .
(46,891,494 missing values generated)

. replace cpi                             = 0.57801       if vuosi == 1988
(1,779,725 real changes made)

. replace cpi                             = 0.61623       if vuosi == 1989
(1,788,273 real changes made)

. replace cpi                             = 0.653403      if vuosi == 1990
(1,801,533 real changes made)

. replace cpi                             = 0.680628      if vuosi == 1991
(1,814,460 real changes made)

. replace cpi                             = 0.697906      if vuosi == 1992
(1,824,610 real changes made)

. replace cpi                             = 0.712565      if vuosi == 1993
(1,834,265 real changes made)

. replace cpi                             = 0.720419      if vuosi == 1994
(1,840,458 real changes made)

. replace cpi                             = 0.727749      if vuosi == 1995
(1,846,754 real changes made)

. replace cpi                             = 0.731937      if vuosi == 1996
(1,852,315 real changes made)

. replace cpi                             = 0.740838      if vuosi == 1997
(1,859,665 real changes made)

. replace cpi                             = 0.751309      if vuosi == 1998
(1,866,910 real changes made)

. replace cpi                             = 0.760209      if vuosi == 1999
(1,872,146 real changes made)

. replace cpi                             = 0.785864      if vuosi == 2000
(1,875,787 real changes made)

. replace cpi                             = 0.805759      if vuosi == 2001
(1,880,402 real changes made)

. replace cpi                             = 0.818325      if vuosi == 2002
(1,884,100 real changes made)

. replace cpi                             = 0.825654      if vuosi == 2003
(1,890,441 real changes made)

. replace cpi                             = 0.827225      if vuosi == 2004
(1,897,537 real changes made)

. replace cpi                             = 0.834555      if vuosi == 2005
(1,906,181 real changes made)

. replace cpi                             = 0.849215      if vuosi == 2006
(1,914,270 real changes made)

. replace cpi                             = 0.870157      if vuosi == 2007
(1,924,798 real changes made)

. replace cpi                             = 0.905759      if vuosi == 2008
(1,934,229 real changes made)

. replace cpi                             = 0.905759      if vuosi == 2009
(1,941,330 real changes made)

. replace cpi                             = 0.916754      if vuosi == 2010
(1,947,369 real changes made)

. replace cpi                             = 0.948691      if vuosi == 2011
(1,956,601 real changes made)

. replace cpi                             = 0.975393      if vuosi == 2012
(1,957,335 real changes made)

. replace cpi                             = 0.989529      if vuosi == 2013
(0 real changes made)

. 
. * wage
. gen tyrtu_defl          = 0

. replace tyrtu_defl      = tyrtu / cpi if tyrtu != .
(6,361,423 real changes made)

. gen tyotu_defl          = 0

. replace tyotu_defl      = tyotu / cpi if tyotu != .
(32,956,250 real changes made)

. gen wage                        = tyotu_defl + tyrtu_defl

. * include capital income 
. gen svatvp_defl         = 0

. replace svatvp_defl = svatvp / cpi if svatvp != .
(11,350,777 real changes made)

. gen earnings            = wage + svatvp_defl

. 
. * generate index within individual
. destring amas2, gen(amas2_var)
amas2: all characters numeric; amas2_var generated as byte
(18150305 missing values generated)

. destring amas1, gen(amas1_var)
amas1: all characters numeric; amas1_var generated as byte
(18826044 missing values generated)

. 
. sort shnro vuosi

. bysort shnro: egen vuosi_min = min(vuosi)                       if (amas2_var !=. | amas1_var !=.)
(16866310 missing values generated)

. gen ind_vuosi           = vuosi - vuosi_min + 1                 if (amas2_var !=. | amas1_var !=.)
(16,866,310 missing values generated)

. 
. * match to Finnish defense forces IQ test data
. *use "W:\fleedinv_88_12.dta", clear
. *drop p_test_year pluku kuv* san* las* p_test_all*
. *merge m:1 shnro using "${ptest_data}\p_tests.dta"
. 
. *rename _merge merge_iq
. *drop if merge_iq == 2
. * coworker status
. * indicators for coworker
. * impute missing sose values
. sort shnro vuosi

. replace sose = sose[_n + 7] if vuosi == 1988 & shnro == shnro[_n + 7] & vuosi[_n + 7] == 1995
(1,581,279 real changes made)

. replace sose = sose[_n + 6] if vuosi == 1989 & shnro == shnro[_n + 6] & vuosi[_n + 6] == 1995
(1,616,681 real changes made)

. replace sose = sose[_n + 5] if vuosi == 1990 & shnro == shnro[_n + 5] & vuosi[_n + 5] == 1995
(1,060,349 real changes made)

. replace sose = sose[_n + 4] if vuosi == 1991 & shnro == shnro[_n + 4] & vuosi[_n + 4] == 1995
(1,695,849 real changes made)

. replace sose = sose[_n + 3] if vuosi == 1992 & shnro == shnro[_n + 3] & vuosi[_n + 3] == 1995
(1,734,605 real changes made)

. replace sose = sose[_n + 2] if vuosi == 1993 & shnro == shnro[_n + 2] & vuosi[_n + 2] == 1995
(1,135,594 real changes made)

. replace sose = sose[_n + 1] if vuosi == 1994 & shnro == shnro[_n + 1] & vuosi[_n + 1] == 1995
(1,809,212 real changes made)

. 
. replace sose = sose[_n - 1] if vuosi == 1996 & shnro == shnro[_n - 1] & vuosi[_n - 1] == 1995
(1,814,180 real changes made)

. replace sose = sose[_n - 2] if vuosi == 1997 & shnro == shnro[_n - 2] & vuosi[_n - 2] == 1995
(1,782,271 real changes made)

. replace sose = sose[_n - 3] if vuosi == 1998 & shnro == shnro[_n - 3] & vuosi[_n - 3] == 1995
(1,750,132 real changes made)

. replace sose = sose[_n - 4] if vuosi == 1999 & shnro == shnro[_n - 4] & vuosi[_n - 4] == 1995
(1,717,023 real changes made)

. 
. replace sose = sose[_n - 1] if vuosi == 2001 & shnro == shnro[_n - 1] & vuosi[_n - 1] == 2000
(1,841,791 real changes made)

. replace sose = sose[_n - 2] if vuosi == 2002 & shnro == shnro[_n - 2] & vuosi[_n - 2] == 2000
(1,808,097 real changes made)

. replace sose = sose[_n - 3] if vuosi == 2003 & shnro == shnro[_n - 3] & vuosi[_n - 3] == 2000
(1,775,940 real changes made)

. 
. replace sose = sose[_n - 1] if vuosi == 2011 & shnro == shnro[_n - 1] & vuosi[_n - 1] == 2010
(487,628 real changes made)

. replace sose = sose[_n - 2] if vuosi == 2012 & shnro == shnro[_n - 2] & vuosi[_n - 2] == 2010
(643,257 real changes made)

. 
. gen soc_status                                          = substr(sose,1,1)
(1,242,134 missing values generated)

. gen soc_status2                                         = substr(sose,1,2)
(1,242,134 missing values generated)

. 
. destring soc_status, gen(soc_status3)
soc_status: all characters numeric; soc_status3 generated as byte
(1242134 missing values generated)

. 
. *bysort inventor: tab soc_status2
. *bysort inventor: tab sose
. *tab soc_status2 if inv_1 == 1
. 
. bysort syrtun vuosi:                            egen inv_firm_count             = total(inv_1)

. bysort sykstun vuosi:                           egen inv_plant_count    = total(inv_1)

. bysort syrtun soc_status vuosi:         egen inv_sose_count             = total(inv_1)

. *bysort syrtun edu_lev vuosi:           egen inv_edu_count              = total(inv_1)
. 
. replace inv_firm_count                          = . if syrtun == ""
(21,396,697 real changes made, 21,396,697 to missing)

. replace inv_plant_count                         = . if sykstun == ""
(22,560,111 real changes made, 22,560,111 to missing)

. replace inv_sose_count                          = . if syrtun == ""
(21,396,697 real changes made, 21,396,697 to missing)

. *replace inv_edu_count                          = . if syrtun == ""
. 
. 
. * NOTE: a coworker is not allowed to be an inventor at any point in time
. global cows firm plant sose 

. gen cw_sum                                                      = .
(46,891,494 missing values generated)

. replace cw_sum                                          = 0 if soc_status3 != .
(45,649,360 real changes made)

. 
. foreach i of global cows {
  2.            gen cw_`i'                              = .
  3.            replace cw_`i'                  = 0 if syrtun != ""
  4.            replace cw_`i'                  = 1 if inv_`i'_count >= 1 & inventor == 0 & inv_`i'_count != . & syrtun != ""
  5.            replace cw_sum                  = cw_sum + cw_`i'
  6.            sort shnro vuosi
  7.            bysort shnro: gen  cw_`i'_cum           = sum(cw_`i')
  8.            } 
(46,891,494 missing values generated)
(25,494,797 real changes made)
(3,421,247 real changes made)
(23,728,622 real changes made, 20,327,154 to missing)
(46,891,494 missing values generated)
(25,494,797 real changes made)
(2,524,183 real changes made)
(2,510,193 real changes made)
(46,891,494 missing values generated)
(25,494,797 real changes made)
(1,628,401 real changes made)
(1,623,648 real changes made)

.                    
. gen syrtun_miss_d                       = 0

. replace syrtun_miss_d           = 1 if syrtun == ""
(21,396,697 real changes made)

. 
. bysort shnro: gen syrtun_miss_cum               = sum(syrtun_miss_d)    

.          
. gen cw_imp                      = .
(46,891,494 missing values generated)

. replace cw_imp          = 0 if syrtun != "" & cw_sose != .
(25,494,797 real changes made)

. replace cw_imp          = 1 if cw_sose != . & (vuosi < 1995 | vuosi == 1996 | vuosi == 1997 | vuosi == 1998 | vuosi == 1999 | vuosi =
> = 2001 | vuosi == 2002 | vuosi == 2003 |  vuosi > 2010)
(15,641,022 real changes made)

. 
. bysort shnro: gen  cw_imp_cum   = sum(cw_imp)

. 
. gen cw_edu_imp                  = .
(46,891,494 missing values generated)

. replace cw_edu_imp              = 0 if syrtun != "" & cw_edu != .
(0 real changes made)

. replace cw_edu_imp              = 1 if cw_edu != . & (vuosi < 1995 | vuosi == 1996 | vuosi == 1997 | vuosi == 1998 | vuosi == 1999 | 
> vuosi == 2001 | vuosi == 2002 | vuosi == 2003 |  vuosi > 2010)
(0 real changes made)

. 
. bysort shnro: gen  cw_edu_imp_cum       = sum(cw_edu_imp)

. 
.                  
. foreach i of global cows {
  2.          bysort shnro: egen  cw_`i'_max          = max(cw_`i'_cum)
  3.          }       

. 
. gen noncowinv                           = 0

. replace noncowinv                       = 1 if  cw_sum == 0
(20,880,278 real changes made)

. 
. gen sose_mngt_sr                        = .
(46,891,494 missing values generated)

. replace sose_mngt_sr                            = 0 if soc_status3 != .
(45,649,360 real changes made)

. replace sose_mngt_sr                            = 1 if soc_status2 == "31" 
(1,452,188 real changes made)

. 
. gen sose_sr                             = .
(46,891,494 missing values generated)

. replace sose_sr                         = 0 if soc_status3 != .
(45,649,360 real changes made)

. replace sose_sr                         = 1 if soc_status == "3" & soc_status2 != "31" & sose_mngt_sr == 0
(4,066,774 real changes made)

.  
. gen sose_mngt_jr                        = .
(46,891,494 missing values generated)

. replace sose_mngt_jr                            = 0 if soc_status3 != .
(45,649,360 real changes made)

. replace sose_mngt_jr                            = 1 if soc_status2 == "41"
(2,109,588 real changes made)

. 
. gen sose_jr                             = .
(46,891,494 missing values generated)

. replace sose_jr                         = 0 if soc_status3 != .
(45,649,360 real changes made)

. replace sose_jr                         = 1 if soc_status == "4" & soc_status != "41" & sose_mngt_jr == 0
(3,799,010 real changes made)

. 
. gen sose_bc                             = .
(46,891,494 missing values generated)

. replace sose_bc                         = 0 if soc_status3 != .
(45,649,360 real changes made)

. replace sose_bc                         = 1 if soc_status == "5"
(11,835,536 real changes made)

. 
. gen sose_agr                            = .
(46,891,494 missing values generated)

. replace sose_agr                        = 0 if soc_status3 != .
(45,649,360 real changes made)

. replace sose_agr                        = 1 if soc_status == "1" 
(1,391,441 real changes made)

. 
. gen sose_entr                           = .
(46,891,494 missing values generated)

. replace sose_entr                       = 0 if soc_status3 != .
(45,649,360 real changes made)

. replace sose_entr                       = 1 if soc_status == "2"
(2,863,828 real changes made)

.  
. gen sose_oth                            = .
(46,891,494 missing values generated)

. replace sose_oth                        = 0 if soc_status3 != .
(45,649,360 real changes made)

. replace sose_oth                        = 1 if soc_status3 != . & (soc_status == "6" | soc_status == "7" | soc_status == "8" | soc_st
> atus == "9") 
(18,130,995 real changes made)

. 
. * keep only necessary variables
. keep vuosi shnro shtun_lyh syrtun sykstun ika toimiala suorv ututku hk_sykstun suuralue /// 
> pat_count_y inv_1 inventor wage earnings  /// 
> sose_mngt_sr sose_sr sose_mngt_jr sose_jr sose_bc sose_entr ///
> family_size_max ptoim1 fwd_cits5_max 

. * generate data for panel regressions
. save "${return_data}\returns_DATAPREP_1_CLEANED.dta", replace
file W:\returns\estimation_data\returns_DATAPREP_1_CLEANED.dta saved

. *log close                 
. 
end of do-file

. do "returns_DATAPREP_2_2022_08_22"                      // matching 

. set more off

. *capture log close
. set logtype text

. set matsize 10000
set matsize ignored.
    Matrix sizes are no longer limited by c(matsize) in modern Statas.  Matrix sizes are now limited by flavor of Stata.  See limits
    for more details.

. 
. local mydate: di %tdDNCY date(c(current_date), "DMY")

. 
. *cd "X:"
. 
. global output   "O:\returns"

. global data             "W:\returns\data_koe" 

. global work             "W:\returns\estimation_data" 

. 
. *log using "${output}\returns_DATAPREP_2_`mydate'.log" , replace
. 
. **************************************************************************************
. 
. * This file performs the CEM matching for
. * Aghion, Akcigit, Hyytinen & Toivanen : 
. * A year older, a year wiser (and farther from the frontier):invention rents and human capital depreciation
. 
. **************************************************************************************
. 
. 
. /*  
> \
> ()
> {}
> []
> =
> `i'
>  >
>  <
>  |
>  +
> */
. 
. * set seed 
. set seed 346352014

. 
. *use "${data}\fleed_returnspanel_iq.dta", clear
. 
. * generating the IQ sample from whole panel
. use "${work}\returns_DATAPREP_1_CLEANED.dta"

. *drop if p_test_year == .
. *save "${data}\fleed_returnspanel_iq.dta", replace
. 
. 
. *********************************************************************************************************
. 
. * variable generation and desc stat
. 
. *********************************************************************************************************
. 
. 
. * generate variables
. * indicator for non-inventor, inventor individual, inventor in the given year
. gen inventor_all                = inventor

. replace inventor_all    = 2 if inv_1 == 1
(31,087 real changes made)

. 
. * 0 = non-inventor
. * 1 = inventor, any year
. * 2 = inventor, year of invention (=AppYear)
. 
. * generate index within individual and year as multiple obs per ind per year due to patents
. bysort shtun_lyh vuosi: gen win_shtun_year_ind = _n

. 
. drop if win_shtun_year_ind > 1
(0 observations deleted)

. * generate index within individual
. bysort shtun_lyh: gen win_shtun_ind = _n

. 
. *********************************************************************************************************
. 
. * cem variables
. 
. *********************************************************************************************************
. 
. * 1. education
. 
. gen educ_level  = substr(ututku,1,1)
(17,446,889 missing values generated)

. destring educ_level, replace
educ_level: all characters numeric; replaced as byte
(17446889 missing values generated)

. 
. gen educ_field  = substr(ututku,2,1)
(17,446,889 missing values generated)

. destring educ_field, replace
educ_field: all characters numeric; replaced as byte
(17446889 missing values generated)

. 
. * education level
. * 0 = esiaste
. * 1 = alempi perusaste
. * 2 = ylempi perusaste
. * 3 = keskiaste
. * 5 = alin korkea-aste
. * 6 = alempi korkeakouluaste
. * 7 = ylempi korkeakouluaste
. * 8 = tutkijakoulutus
. * 9 = tuntematon
. * our classification
. * 1 base
. * 2 secondary
. * 3 uni
. * 4 Msc/PhD
. * NOTE: classification different for parents, as they are an older cohort
. gen edu_lev             = 1 /* levels  0, 1, 2, 9, NOTE: also imposes lowest educ on those with missing educ */ 

. replace edu_lev         = 2 if educ_level == 3 
(18,894,110 real changes made)

. replace edu_lev         = 3 if educ_level == 5
(4,465,432 real changes made)

. replace edu_lev         = 3 if educ_level == 6
(2,845,563 real changes made)

. replace edu_lev         = 4 if educ_level == 7
(2,784,236 real changes made)

. replace edu_lev         = 5 if educ_level == 8
(365,541 real changes made)

. 
. gen msc                         = .
(46,891,494 missing values generated)

. replace msc                     = 0 if edu_lev <= 3
(43,741,717 real changes made)

. replace msc                     = 1 if edu_lev > 3 & edu_lev != .
(3,149,777 real changes made)

. replace msc             = 1 if edu_lev >= 3 & edu_lev != . & sose_bc == 1 
(485,530 real changes made)

. 
. * education field
. * 1 humanistinen ja esteettinen
. * 2 opettajankoul
. * 3 kauppa ja tstoala, laki, yhteiskunta ja kayttaytymistiet
. * 4 tekniikka ja luonnotiede
. * 5 liikenne ja tietoliikenne
. * 6 hoitoala
. * 7 maa ja metsa
. * 8 muiden alojen
. 
. gen edu_science         = 0

. replace edu_science = 1 if educ_field == 4 | educ_field == 5 | educ_field == 7 
(17,230,505 real changes made)

. 
. * 2. industry
. *tab toimiala2 if edu_lev != .
. /*
> 2002
> 
> A Maatalous riistatalous ja metsatalous 01 - 02
> B kalatalous                                                    05
> C kaivostoiminta ja louhinta                    10 - 14
> D teollisuus                                                    15 - 37
> E sahko kaasu ja vesihuolto                             40 - 41
> F rakentaminen                                                  45
> G tukku ja vahittaiskauppa, moottoriajoneuvojen
> seka henkkoht esineiden ja kotitalousesineiden
> korjaus                                                                 50 - 52
> H majoitus ja ravitsemustoiminta                55
> I kuljetus, varastointi ja tietoliikenne 60 - 64
> J rahoitustoiminta                                              65 - 67
> K kiinteisto vuokraus ja tutkimuspalvelut
> liike-elaman palvelut                                   70 - 74
> L julkinen hallinto ja maanpuol, 
> pakollinen sosiaalivakuutus                             75
> M koulutus                                                              80
> N terveydenhuolto ja sosiaalipalv               85
> O muut yhteiskunnalliset ja henkilo
> kohtaiset palvelut                                              90-93
> P tyonantajakotitaloudet seke kotitalouksien itse
> tuottamat tavarat ja palvelut                   95 - 07
> Q kv jarjestot ja ulkom edustustot              98
> X toimiala tuntematon                                   99
> 
> 2008
> 
> A Maatalous metsatalous ja kalatalous   01 - 03
> B kaivostoiminta ja louhinta                    05 - 09
> C teollisuus                                                    10 - 33
> D sahko kaasu lampohuolto, 
> jaahdytysliiketoiminta                                  35
> E vesihuolto, viemari ja jatevesihuolto jatehuolto 
> ja muu ympariston puhtaanapito                  36 - 39
> F rakentaminen                                                  41 - 43
> G tukku ja vahittaiskauppa, moottoriajoneuvojen
> ja moottoripyorien korjaus                              45 - 47
> H kuljetus, varastointi                                 49 - 53
> I majoitus ja ravitsemustoiminta                55 - 56
> J informaatio ja viestinta                              58 - 63
> K rahoitus ja vakuutustoiminta                  64 - 66
> L kiinteistoalan toiminta                               68
> M ammatillinen tieteellinen ja 
> tekninen toiminta                                               69 - 75
> N hallinto ja tukipalvelutoiminta               77 - 82
> O julkinen hallinto ja maanpuol, 
> pakollinen sosiaalivakuutus                             84
> P koulutus                                                              85
> Q terveys ja sosiaalipalv                               86 - 88
> R taiteet, viihde ja virkistys                  90 - 93
> S muu palvelutoiminta                                   94 - 96
> T kotitalouksien toiminta tyonantajana, kotitalouksien
> eriyttamaton toiminta tavaroiden ja palvelujen
> tuottamiseksi omaan kayttoon                    97 - 98
> U kv organisaatioiden ja toimielinten
> toiminta                                                                99
> X toimiala tuntematon                                   00
> 
> 
>   
> */
. 
. gen industry2           = substr(toimiala,1,2)
(9,671,735 missing values generated)

. tab industry2           if edu_lev != .

  industry2 |      Freq.     Percent        Cum.
------------+-----------------------------------
         00 |     84,105        0.23        0.23
         01 |  1,547,939        4.16        4.38
         02 |    291,228        0.78        5.17
         03 |      5,784        0.02        5.18
         04 |    102,687        0.28        5.46
         05 |     17,978        0.05        5.51
         07 |     11,615        0.03        5.54
         08 |     18,957        0.05        5.59
         09 |     19,272        0.05        5.64
         10 |    111,769        0.30        5.94
         11 |    148,642        0.40        6.34
         12 |     20,255        0.05        6.40
         13 |     36,568        0.10        6.49
         14 |    165,472        0.44        6.94
         15 |    439,535        1.18        8.12
         16 |    218,437        0.59        8.71
         17 |    193,697        0.52        9.23
         18 |    120,372        0.32        9.55
         19 |     37,755        0.10        9.65
         20 |    360,884        0.97       10.62
         21 |    418,353        1.12       11.74
         22 |    371,165        1.00       12.74
         23 |    163,368        0.44       13.18
         24 |    361,066        0.97       14.15
         25 |    591,044        1.59       15.74
         26 |    414,263        1.11       16.85
         27 |    365,055        0.98       17.83
         28 |    667,514        1.79       19.63
         29 |    743,599        2.00       21.62
         30 |     56,638        0.15       21.78
         31 |    245,264        0.66       22.44
         32 |    303,141        0.81       23.25
         33 |    206,843        0.56       23.81
         34 |     97,812        0.26       24.07
         35 |    534,107        1.44       25.50
         36 |    323,765        0.87       26.37
         37 |    178,142        0.48       26.85
         38 |     54,812        0.15       27.00
         39 |      1,729        0.00       27.00
         40 |    174,036        0.47       27.47
         41 |    592,483        1.59       29.06
         42 |    112,926        0.30       29.37
         43 |    622,984        1.67       31.04
         44 |     48,499        0.13       31.17
         45 |  1,945,000        5.23       36.40
         46 |    343,201        0.92       37.32
         47 |    297,856        0.80       38.12
         48 |     50,065        0.13       38.25
         49 |    409,737        1.10       39.35
         50 |    490,213        1.32       40.67
         51 |    831,591        2.23       42.91
         52 |    968,252        2.60       45.51
         53 |    110,574        0.30       45.80
         54 |     12,680        0.03       45.84
         55 |    273,818        0.74       46.57
         56 |    177,959        0.48       47.05
         57 |     77,635        0.21       47.26
         58 |    103,357        0.28       47.54
         59 |     16,645        0.04       47.58
         60 |    917,911        2.47       50.05
         61 |    186,351        0.50       50.55
         62 |    256,876        0.69       51.24
         63 |    271,412        0.73       51.97
         64 |    399,965        1.07       53.04
         65 |    202,856        0.55       53.59
         66 |    158,166        0.42       54.01
         67 |     37,525        0.10       54.11
         68 |     66,529        0.18       54.29
         69 |     37,996        0.10       54.40
         70 |    311,961        0.84       55.23
         71 |    352,111        0.95       56.18
         72 |    379,675        1.02       57.20
         73 |    140,294        0.38       57.58
         74 |  1,046,331        2.81       60.39
         75 |    849,349        2.28       62.67
         76 |     49,903        0.13       62.80
         77 |     28,029        0.08       62.88
         78 |    126,249        0.34       63.22
         79 |      8,639        0.02       63.24
         80 |    749,376        2.01       65.25
         81 |    311,425        0.84       66.09
         82 |    135,136        0.36       66.45
         83 |     64,034        0.17       66.63
         84 |    325,154        0.87       67.50
         85 |  1,035,949        2.78       70.28
         86 |    180,770        0.49       70.77
         87 |    151,937        0.41       71.18
         88 |     93,070        0.25       71.43
         90 |    121,404        0.33       71.75
         91 |    260,713        0.70       72.45
         92 |    293,184        0.79       73.24
         93 |     94,135        0.25       73.49
         94 |    108,720        0.29       73.79
         95 |     34,133        0.09       73.88
         96 |     21,988        0.06       73.94
         97 |      1,440        0.00       73.94
         98 |        745        0.00       73.94
         99 |  9,584,319       25.75       99.69
         DN |     21,189        0.06       99.75
          F |     23,847        0.06       99.82
          N |      1,139        0.00       99.82
          O |     46,394        0.12       99.94
          P |      5,165        0.01       99.96
          R |        215        0.00       99.96
          T |     15,908        0.04      100.00
------------+-----------------------------------
      Total | 37,219,759      100.00

. replace industry2       = "15" if industry2 == "DN" & vuosi < 2001
(21,189 real changes made)

. replace industry2       = "45" if industry2 == "F" & vuosi < 2001
(23,847 real changes made)

. replace industry2       = "85" if industry2 == "N" & vuosi < 2001
(0 real changes made)

. replace industry2       = "90" if industry2 == "O" & vuosi < 2001
(27,848 real changes made)

. replace industry2       = "95" if industry2 == "P" & vuosi < 2001
(5,165 real changes made)

. replace industry2       = "97" if industry2 == "T" & vuosi < 2001
(15,908 real changes made)

. 
. replace industry2       = "35" if industry2 == "DN" & vuosi >= 2001
(0 real changes made)

. replace industry2       = "41" if industry2 == "F" & vuosi >= 2001
(0 real changes made)

. replace industry2       = "77" if industry2 == "N" & vuosi >= 2001
(1,139 real changes made)

. replace industry2       = "84" if industry2 == "O" & vuosi >= 2001
(18,546 real changes made)

. replace industry2       = "85" if industry2 == "P" & vuosi >= 2001
(0 real changes made)

. replace industry2       = "90" if industry2 == "R" & vuosi >= 2001
(215 real changes made)

. replace industry2       = "97" if industry2 == "T" & vuosi >= 2001
(0 real changes made)

. 
. destring industry2, replace
industry2: all characters numeric; replaced as byte
(9671735 missing values generated)

. 
. gen manuf                       = .
(46,891,494 missing values generated)

. replace manuf           = 0     if industry2 != .
(37,219,759 real changes made)

. * source: Tilastokeskus webpage toimialaluokitus 1988
. replace manuf           = 1     if industry2 >= 11 & industry2 <= 29 & vuosi<= 1992
(1,500,093 real changes made)

. * source: TOL95 - toinen tarkistettu painos
. replace manuf           = 1     if industry2 >= 15 & industry2 < 40 & vuosi > 1992 & vuosi <= 2000
(2,234,019 real changes made)

. * source: Toimialaluokitus 2002 
. replace manuf           = 1     if industry2 >= 15 & industry2 <= 37 & vuosi > 2000 & vuosi <= 2006
(1,777,174 real changes made)

. * source: Toimialaluokitus 2008
. replace manuf           = 1     if  industry2 >= 10 & industry2 <= 33 & vuosi > 2006 
(1,552,944 real changes made)

. 
. 
. * 3. firm size
. /*
> *FIRM SIZE AGGREGATED WITH hk_sykstun
> bysort sykstun vuosi: gen sykstun_ind = _n
> gen hk_sykstun_temp             = hk_sykstun if sykstun_ind == 1
> bysort syrtun vuosi: egen empl = total(hk_sykstun_temp), missing 
> */
. 
.  *firm size by observed rows per year per syrtun
.  bysort syrtun vuosi: gen firm_size = _N

.  replace firm_size = . if syrtun == ""
(21,396,697 real changes made, 21,396,697 to missing)

. 
. forvalues i = 1994/2010 {
  2.  xtile firm_size_q_`i'                   = firm_size if vuosi == `i', nq(5)
  3.  }   

. 
. * SME status
. gen sme                         = .
(46,891,494 missing values generated)

. replace sme                     = 0 if firm_size >= 250 & firm_size != .
(9,560,858 real changes made)

. replace sme                     = 1 if firm_size < 250 & firm_size != .
(15,933,939 real changes made)

. 
. 
. * 4. region
. * suuralue 
. * 1 southern finland
. * 2 western finland
. * 3 eastern finland
. * 4 northern finland
. * 5 aland island
. 
. destring suuralue, gen(region)
suuralue: all characters numeric; region generated as byte
(10879018 missing values generated)

. 
. gen region_large                = .
(46,891,494 missing values generated)

. replace region_large    = 1 if region != .
(36,012,476 real changes made)

. replace region_large    = 2 if region == 3
(5,179,585 real changes made)

. replace region_large    = 2 if region == 4
(5,044,410 real changes made)

. 
. * 5. age
. gen age                 = .
(46,891,494 missing values generated)

. replace age             = 1 if ika <= 30
(13,572,683 real changes made)

. replace age             = 2 if ika > 30 & ika <= 40
(9,269,698 real changes made)

. replace age             = 3 if ika > 40 & ika <= 50
(9,749,486 real changes made)

. replace age             = 4 if ika > 50
(14,299,627 real changes made)

. 
. * 6. IQ
. /*
> gen iq                  = 1
> replace iq              = 2 if kuv_pc > 50 & kuv_pc <= 80
> replace iq              = 3 if kuv_pc > 80 & kuv_pc <= 90
> replace iq              = 4 if kuv_pc > 90 & kuv_pc <= 100
> */
. * 7. wage growth and levels
. sort shnro vuosi

. bysort shnro: gen dwage                 = (wage[_n - 1] - wage[_n - 2]) / (2 * wage[_n - 2]) + (wage[_n - 2] - wage[_n - 3]) / (2 * w
> age[_n - 3]) if wage[_n - 2] != . & wage[_n - 3] != .
(17,918,637 missing values generated)

. replace dwage           = (wage[_n - 1] - wage[_n - 2]) / wage[_n - 2] if wage[_n - 3] == 0
(2,754,097 real changes made)

. replace dwage           = (wage[_n - 2] - wage[_n - 3]) / wage[_n - 3] if wage[_n - 2] == 0
(2,754,098 real changes made)

. tabstat dwage, stat(p10 p25 p50 p75 p90)

    variable |       p10       p25       p50       p75       p90
-------------+--------------------------------------------------
       dwage | -.9645091 -.1262909  .0206252  .1644994   .996551
----------------------------------------------------------------

. 
. forvalues i = 1994/2010 {
  2.         xtile dwage_q_`i'               =  dwage if  vuosi == `i', nq(5)
  3.         }

. 
. sort shnro vuosi

. gen wage_l1                     = .
(46,891,494 missing values generated)

. replace wage_l1         = wage[_n - 1] if shnro == shnro[_n - 1]
(44,180,081 real changes made)

. gen wage_l2                     = .
(46,891,494 missing values generated)

. replace wage_l2         = wage[_n - 2] if shnro == shnro[_n - 2]
(41,543,134 real changes made)

. gen wage_l3                     = .
(46,891,494 missing values generated)

. replace wage_l3         = wage[_n - 3] if shnro == shnro[_n - 3]
(38,977,065 real changes made)

. gen wage_l4                     = .
(46,891,494 missing values generated)

. replace wage_l4         = wage[_n - 4] if shnro == shnro[_n - 4]
(36,483,951 real changes made)

. 
. egen wage_lavg          = rowmean(wage_l1 wage_l2 wage_l3 wage_l4)
(2711413 missing values generated)

. 
. forvalues i = 1994/2010 {
  2.         xtile wage_lavgq_`i'            =  wage_lavg if  vuosi == `i', nq(5)
  3.         }

.         
. gen wage_l14_obs                = .
(46,891,494 missing values generated)

. replace wage_l14_obs    = 1 if wage_l1 != . & wage_l2 != . & wage_l3 != . & wage_l4 != .
(36,483,951 real changes made)

. 
. * 8. dtf & suorv_d
. gen dtf                                         = vuosi - suorv
(22,157,600 missing values generated)

. replace dtf                                     = ika - 15              if dtf > ika - 15 & dtf != .  & suorv != .
(963 real changes made)

. 
. gen suorv_d                             = 0

. replace suorv_d                 = 1                             if suorv == .
(22,157,600 real changes made)

. 
. * 9. inspect cem variables
. sum msc edu_science manuf sme region_large dtf

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         msc | 46,891,494    .0775259    .2674241          0          1
 edu_science | 46,891,494    .3674548    .4821118          0          1
       manuf | 37,219,759    .1897978    .3921411          0          1
         sme | 25,494,797    .6249879    .4841261          0          1
region_large | 36,012,476    1.283901    .4508896          1          2
-------------+---------------------------------------------------------
         dtf | 24,733,894    13.73833    10.41955          0         55

. tab age 

        age |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 | 13,572,683       28.94       28.94
          2 |  9,269,698       19.77       48.71
          3 |  9,749,486       20.79       69.50
          4 | 14,299,627       30.50      100.00
------------+-----------------------------------
      Total | 46,891,494      100.00

. *tab iq
. 
. *tab suuralue inventor_all if win_shtun_ind == 1
. 
. *********************************************************************************************************
. 
. * cem variables
. 
. ***************************************************************************************
. bysort syrtun:                          egen inv_firm           = total(inventor), missing

. replace inv_firm                        = . if syrtun == ""
(21,396,697 real changes made, 21,396,697 to missing)

. 
. gen inv_firm_d                          = .
(46,891,494 missing values generated)

. replace inv_firm_d                      = 0 if inv_firm == 0 & syrtun != ""
(12,097,946 real changes made)

. replace inv_firm_d                      = 1 if inv_firm > 0 & syrtun != "" & inv_firm != .
(13,396,851 real changes made)

. 
. gen inventor_cem_sample         = 0

. 
. bysort syrtun vuosi: egen inv_firm_year         = total(inv_1), missing

. replace inv_firm_year           = . if syrtun == ""
(21,396,697 real changes made, 21,396,697 to missing)

. 
. gen inv_firm_year_d                     = .
(46,891,494 missing values generated)

. replace inv_firm_year_d         = 0 if inv_firm_year == 0 & syrtun != ""
(21,910,017 real changes made)

. replace inv_firm_year_d         = 1 if inv_firm_year > 0 & syrtun != "" & inv_firm_year != .
(3,584,780 real changes made)

. 
. save "${work}\returns_DATAPREP_temp_CLEANED.dta", replace
file W:\returns\estimation_data\returns_DATAPREP_temp_CLEANED.dta saved

. 
. *use "${data}\returns_DATAPREP_temp_iq.dta", clear
. 
. 
. *********************************************************************************************************
. * inventor cem sample
. *********************************************************************************************************
. **********************************************
. * use firm size quintiles instead of SME
. **********************************************
. /*
> use "${data}\fleed_returnspanel_iq_cem.dta", clear
> preserve
> 
> forvalues i = 1994/2010 {
>         
>         restore
>         preserve
>         
>         keep if (inv_firm_d == 0 | (inv_1 == 1 & syrtun != "")) &  wage_l14_obs == 1 & vuosi == `i'
>         
>         if vuosi != 1994 {
>                 merge 1:1 shnro using "${data}\cemE.dta"
>                 drop if cem_matched == 1 & inventor == 0
>                 keep if _merge == 1
>                 drop _merge
>                 }
>         
>         display "vuosi on `i'"
>         cem msc edu_science manuf empl_q_`i' region_large iq age, treatment(inv_1) k2k
>         
>         keep if cem_matched     == 1
>         keep shnro vuosi cem_matched cem_weights
>         if vuosi == 1994 {
>                 save "${data}\cemE.dta", replace
>                 }
>         else {
>                 append using "${data}\cemE.dta"
>                 save "${data}\cemEm.dta", replace
>                 }
>         }
> restore 
> 
> preserve
> merge 1:1 shnro vuosi using "${data}\cemE.dta"
> 
> * keeping all obs of matched individuals
> bysort shnro: egen cem_sample   = max(cem_matched)
> 
> keep if cem_sample == 1 | inventor == 1
> 
> save "${data}\cem_estim_inventorsE.dta", replace
> 
> restore
> 
> 
> 
> *********************************************************************************************************
> * add wage growth and levels to CEM vector
> *********************************************************************************************************
> 
> preserve
> 
> forvalues i = 1994/2010 {
>         
>         restore
>         preserve
>         
>         keep if (inv_firm_d == 0 | (inv_1 == 1 & syrtun != "")) &  wage_l14_obs == 1 & vuosi == `i'
>         
>         if vuosi != 1994 {
>                 merge 1:1 shnro using "${data}\cemD.dta"
>                 drop if cem_matched == 1 & inventor == 0
>                 keep if _merge == 1
>                 drop _merge
>                 }
>         
>         display "vuosi on `i'"
>         cem msc edu_science manuf empl_q_`i' region_large iq age dwage_q_`i' wage_lavgq_`i', treatment(inv_1) k2k
>         
>         keep if cem_matched     == 1
>         keep shnro vuosi cem_matched
>         if vuosi == 1994 {
>                 save "${data}\cemD.dta", replace
>                 }
>         else {
>                 append using "${data}\cemD.dta"
>                 save "${data}\cemD.dta", replace
>                 }
>         }
> restore 
> 
> preserve
> merge 1:1 shnro vuosi using "${data}\cemD.dta"
> 
> * keeping all obs of matched individuals
> bysort shnro: egen cem_sample   = max(cem_matched)
> 
> keep if cem_sample == 1 | inventor == 1
> 
> save "${data}\cem_estim_inventorsD.dta", replace
> 
> restore
> 
> 
> *********************************************************************************************************
> 
> * coworker samples
> 
> *********************************************************************************************************
> 
> gen treated_cow                         = .
> replace treated_cow                     = .
> preserve
> global sose_types sose_mngt_sr sose_sr sose_mngt_jr sose_jr sose_bc 
> 
> foreach j of global sose_types {
>         forvalues i = 1994/2010 {
>                 
>                 restore
>                 preserve
>                 
>                 replace treated_cow             = .
>                 replace treated_cow             = 0 if inv_firm_d == 0 & syrtun != "" & `j' == 1
>                 replace treated_cow             = 1 if inv_firm_year_d == 1 & inventor == 0 & syrtun != "" & `j' == 1 
>                 
>                 keep if treated_cow != . &  wage_l14_obs == 1 & vuosi == `i'
>                 
>                 if vuosi != 1994 {
>                         merge 1:1 shnro using "${data}\cem_`j'E.dta"
>                         drop if cem_matched == 1 & treated_cow == 0
>                         keep if _merge == 1
>                         drop _merge
>                         }
>                 
>                 display "vuosi on `i'"
>                 cem msc edu_science manuf  empl_q_`i' region_large iq age, treatment(treated_cow) k2k
>                 
>                 keep if cem_matched     == 1
>                 keep shnro vuosi cem_matched treated_cow cem_weights
>                 if vuosi == 1994 {
>                         save "${data}\cem_`j'E.dta", replace
>                         }
>                 else {
>                         append using "${data}\cem_`j'E.dta"
>                         save "${data}\cem_`j'E.dta", replace
>                         }
>                 }
>         }
> restore 
> 
> *use "${data}\fleed_returnspanel_iq_cem.dta", clear
> drop treated_cow
> foreach j of global sose_types {
>         preserve
>         merge 1:1 shnro vuosi using "${data}\cem_`j'E.dta"
> 
>         * keeping all obs of matched individuals
>         bysort shnro: egen cem_sample   = max(cem_matched)
> 
>         keep if cem_sample == 1 
> 
>         save "${data}\cem_estim_`j'E.dta", replace
> 
>         restore
>         }
> 
> *********************************************************************************************************
> * exclude IQ from CEM vector
> *********************************************************************************************************
> */
. *use "W:\returns\data_koe\returns_DATAPREP_temp_CLEANED.dta", clear
. 
. 
. gen treated_cow                         = .
(46,891,494 missing values generated)

. *replace treated_cow                    = .
. preserve

. global sose_types sose_mngt_sr sose_sr sose_mngt_jr sose_jr  sose_bc

. 
. foreach j of global sose_types {
  2.         forvalues i = 1994/2010 {
  3.                 
.                 restore
  4.                 preserve
  5.                 
.                 replace treated_cow             = .
  6.                 replace treated_cow             = 0 if inv_firm_d == 0 & syrtun != "" & `j' == 1
  7.                 replace treated_cow             = 1 if inv_firm_year_d == 1 & inventor == 0 & syrtun != "" & `j' == 
> 1 
  8.                 
.                 keep if treated_cow != . &  wage_l14_obs == 1 & vuosi == `i'
  9.                 
.                 if vuosi != 1994 {
 10.                         merge 1:1 shnro using "${work}\returns_EST_temp`j'G.dta"
 11.                         drop if cem_matched == 1 & treated_cow == 0
 12.                         keep if _merge == 1
 13.                         drop _merge
 14.                         }
 15.                 
.                 display "vuosi on `i'"
 16.                 cem msc (#0) edu_science (#0) manuf (#0) firm_size_q_`i' (#0) region_large (#0) age (#0) dtf (5 10 1
> 5 20) suorv_d (#0) , treatment(treated_cow) k2k
 17.                 
.                 keep if cem_matched     == 1
 18.                 keep shnro vuosi cem_matched treated_cow cem_weights
 19.                 if vuosi == 1994 {
 20.                         save "${work}\returns_EST_temp`j'G.dta", replace
 21.                         }
 22.                 else {
 23.                         append using "${work}\returns_EST_temp`j'G.dta"
 24.                         save "${work}\returns_EST_temp`j'G.dta", replace
 25.                         }
 26.                 }
 27.         }
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,868,053 observations deleted)
vuosi on 1994

Matching Summary:
-----------------
Number of strata: 1066
Number of matched strata: 245

               0      1
      All  20054   3387
  Matched    687    687
Unmatched  19367   2700


Multivariate L1 distance: .28093159

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1994       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .08006  .10189       0       1       0       .       .
         suorv_d       0       0       0       0       0       0       0
(22,067 observations deleted)
(note: file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta not found)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,865,945 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        25,007
        from master                    24,591  (_merge==1)
        from using                        416  (_merge==2)

    matched                               958  (_merge==3)
    -----------------------------------------
(709 observations deleted)
(665 observations deleted)
vuosi on 1995

Matching Summary:
-----------------
Number of strata: 1080
Number of matched strata: 222

               0      1
      All  20885   3706
  Matched    616    616
Unmatched  20269   3090


Multivariate L1 distance: .27597403

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1995       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .05032  .25487       0       1       0       1       .
         suorv_d       0       0       0       0       0       0       0
(23,359 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,866,837 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        24,023
        from master                    23,037  (_merge==1)
        from using                        986  (_merge==2)

    matched                             1,620  (_merge==3)
    -----------------------------------------
(1,333 observations deleted)
(1,273 observations deleted)
vuosi on 1996

Matching Summary:
-----------------
Number of strata: 1254
Number of matched strata: 173

               0      1
      All  18628   4409
  Matched    309    309
Unmatched  18319   4100


Multivariate L1 distance: .29449838

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1996       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       .
             age       0       0       0       0       0       0       0
             dtf  .05502  .01294       0       0      -1       1       .
         suorv_d       0       0       0       0       0       0       0
(22,419 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,868,134 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        22,798
        from master                    21,467  (_merge==1)
        from using                      1,331  (_merge==2)

    matched                             1,893  (_merge==3)
    -----------------------------------------
(1,664 observations deleted)
(1,560 observations deleted)
vuosi on 1997

Matching Summary:
-----------------
Number of strata: 1025
Number of matched strata: 167

               0      1
      All  17867   3600
  Matched    291    291
Unmatched  17576   3309


Multivariate L1 distance: .30927835

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1997       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .09966  .12715      -1       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(20,885 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,868,238 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        22,824
        from master                    21,137  (_merge==1)
        from using                      1,687  (_merge==2)

    matched                             2,119  (_merge==3)
    -----------------------------------------
(1,988 observations deleted)
(1,818 observations deleted)
vuosi on 1998

Matching Summary:
-----------------
Number of strata: 1023
Number of matched strata: 174

               0      1
      All  17177   3960
  Matched    446    446
Unmatched  16731   3514


Multivariate L1 distance: .31165919

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_1998        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .06054  -.23991        0        0        0       -2        .
         suorv_d        0        0        0        0        0        0        0
(20,245 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,869,202 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        22,074
        from master                    19,834  (_merge==1)
        from using                      2,240  (_merge==2)

    matched                             2,458  (_merge==3)
    -----------------------------------------
(2,463 observations deleted)
(2,235 observations deleted)
vuosi on 1999

Matching Summary:
-----------------
Number of strata: 1009
Number of matched strata: 177

               0      1
      All  16312   3522
  Matched    395    395
Unmatched  15917   3127


Multivariate L1 distance: .30379747

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1999       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .07342   .1038       0      -1       0       1       .
         suorv_d       0       0       0       0       0       0       0
(19,044 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,862,733 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        30,701
        from master                    26,987  (_merge==1)
        from using                      3,714  (_merge==2)

    matched                             1,774  (_merge==3)
    -----------------------------------------
(2,817 observations deleted)
(2,671 observations deleted)
vuosi on 2000

Matching Summary:
-----------------
Number of strata: 1150
Number of matched strata: 280

               0      1
      All  20375   6612
  Matched    789    789
Unmatched  19586   5823


Multivariate L1 distance: .29404309

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2000        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04563  -.03042        0       -1        0        0        .
         suorv_d        0        0        0        0        0        0        0
(25,409 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,864,223 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        28,965
        from master                    24,585  (_merge==1)
        from using                      4,380  (_merge==2)

    matched                             2,686  (_merge==3)
    -----------------------------------------
(3,618 observations deleted)
(3,448 observations deleted)
vuosi on 2001

Matching Summary:
-----------------
Number of strata: 1126
Number of matched strata: 230

               0      1
      All  18730   5855
  Matched    622    622
Unmatched  18108   5233


Multivariate L1 distance: .2926045

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2001       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .05788  .03055       0       0       0       1       .
         suorv_d       0       0       0       0       0       0       0
(23,341 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,865,680 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        27,652
        from master                    22,578  (_merge==1)
        from using                      5,074  (_merge==2)

    matched                             3,236  (_merge==3)
    -----------------------------------------
(4,322 observations deleted)
(3,988 observations deleted)
vuosi on 2002

Matching Summary:
-----------------
Number of strata: 1067
Number of matched strata: 181

               0      1
      All  17392   5186
  Matched    382    382
Unmatched  17010   4804


Multivariate L1 distance: .34031414

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2002        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04712  -.28272        1       -1        0        0        .
         suorv_d        0        0        0        0        0        0        0
(21,814 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,867,163 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        26,481
        from master                    20,869  (_merge==1)
        from using                      5,612  (_merge==2)

    matched                             3,462  (_merge==3)
    -----------------------------------------
(4,764 observations deleted)
(4,310 observations deleted)
vuosi on 2003

Matching Summary:
-----------------
Number of strata: 1054
Number of matched strata: 157

               0      1
      All  16413   4456
  Matched    326    326
Unmatched  16087   4130


Multivariate L1 distance: .3190184

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2003       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .08282  .10736       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(20,217 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,859,832 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        35,626
        from master                    28,781  (_merge==1)
        from using                      6,845  (_merge==2)

    matched                             2,881  (_merge==3)
    -----------------------------------------
(5,097 observations deleted)
(4,629 observations deleted)
vuosi on 2004

Matching Summary:
-----------------
Number of strata: 1163
Number of matched strata: 312

               0      1
      All  22244   6537
  Matched    841    841
Unmatched  21403   5696


Multivariate L1 distance: .3412604

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2004        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .05945  -.13436        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(27,099 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,851,335 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        44,679
        from master                    36,715  (_merge==1)
        from using                      7,964  (_merge==2)

    matched                             3,444  (_merge==3)
    -----------------------------------------
(6,028 observations deleted)
(5,380 observations deleted)
vuosi on 2005

Matching Summary:
-----------------
Number of strata: 1200
Number of matched strata: 358

               0      1
      All  29829   6886
  Matched   1457   1457
Unmatched  28372   5429


Multivariate L1 distance: .31297186

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2005        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .07893  -.35553        0        0        0       -1        .
         suorv_d        0        0        0        0        0        0        0
(33,801 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,849,321 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        46,557
        from master                    37,204  (_merge==1)
        from using                      9,353  (_merge==2)

    matched                             4,969  (_merge==3)
    -----------------------------------------
(7,532 observations deleted)
(6,790 observations deleted)
vuosi on 2006

Matching Summary:
-----------------
Number of strata: 1238
Number of matched strata: 319

               0      1
      All  29712   7492
  Matched    918    918
Unmatched  28794   6574


Multivariate L1 distance: .32135076

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2006        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .05773  -.16558        0       -1        1       -1        .
         suorv_d        0        0        0        0        0        0        0
(35,368 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,848,197 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        48,949
        from master                    38,044  (_merge==1)
        from using                     10,905  (_merge==2)

    matched                             5,253  (_merge==3)
    -----------------------------------------
(8,460 observations deleted)
(7,698 observations deleted)
vuosi on 2007

Matching Summary:
-----------------
Number of strata: 1205
Number of matched strata: 310

               0      1
      All  30379   7665
  Matched    846    846
Unmatched  29533   6819


Multivariate L1 distance: .32624113

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2007        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .06856  -.04019        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(36,352 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,846,266 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,624
        from master                    39,501  (_merge==1)
        from using                     12,123  (_merge==2)

    matched                             5,727  (_merge==3)
    -----------------------------------------
(9,371 observations deleted)
(8,479 observations deleted)
vuosi on 2008

Matching Summary:
-----------------
Number of strata: 1238
Number of matched strata: 307

               0      1
      All  31191   8310
  Matched   1032   1032
Unmatched  30159   7278


Multivariate L1 distance: .29166667

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2008        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .05426  -.06202        0        0        0       -1        .
         suorv_d        0        0        0        0        0        0        0
(37,437 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,848,394 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,116
        from master                    37,151  (_merge==1)
        from using                     13,965  (_merge==2)

    matched                             5,949  (_merge==3)
    -----------------------------------------
(10,428 observations deleted)
(9,486 observations deleted)
vuosi on 2009

Matching Summary:
-----------------
Number of strata: 1198
Number of matched strata: 271

               0      1
      All  29962   7189
  Matched    622    622
Unmatched  29340   6567


Multivariate L1 distance: .28778135

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2009        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .05627  -.04019        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(35,907 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(569,250 real changes made)
(147,735 real changes made)
(46,862,733 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        41,127
        from master                    24,365  (_merge==1)
        from using                     16,762  (_merge==2)

    matched                             4,396  (_merge==3)
    -----------------------------------------
(10,913 observations deleted)
(10,245 observations deleted)
vuosi on 2010

Matching Summary:
-----------------
Number of strata: 1131
Number of matched strata: 209

               0      1
      All  18139   6226
  Matched    620    620
Unmatched  17519   5606


Multivariate L1 distance: .32741935

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2010        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .05484  -.28871        0        0       -1       -2        .
         suorv_d        0        0        0        0        0        0        0
(23,125 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,839,624 observations deleted)
vuosi on 1994

Matching Summary:
-----------------
Number of strata: 1248
Number of matched strata: 354

               0      1
      All  32382  19488
  Matched   2218   2218
Unmatched  30164  17270


Multivariate L1 distance: .26555455

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_1994        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .06583  -.07439        0        0       -1        0        .
         suorv_d        0        0        0        0        0        0        0
(47,434 observations deleted)
(note: file W:\returns\estimation_data\returns_EST_tempsose_srG.dta not found)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,833,730 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        56,226
        from master                    54,777  (_merge==1)
        from using                      1,449  (_merge==2)

    matched                             2,987  (_merge==3)
    -----------------------------------------
(2,237 observations deleted)
(2,199 observations deleted)
vuosi on 1995

Matching Summary:
-----------------
Number of strata: 1266
Number of matched strata: 304

               0      1
      All  33329  21448
  Matched   1272   1272
Unmatched  32057  20176


Multivariate L1 distance: .26808176

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_1995        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .03774  -.10142        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(52,233 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,832,948 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        56,594
        from master                    54,080  (_merge==1)
        from using                      2,514  (_merge==2)

    matched                             4,466  (_merge==3)
    -----------------------------------------
(3,477 observations deleted)
(3,503 observations deleted)
vuosi on 1996

Matching Summary:
-----------------
Number of strata: 1566
Number of matched strata: 240

               0      1
      All  29482  24598
  Matched    964    964
Unmatched  28518  23634


Multivariate L1 distance: .22717842

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_1996        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        .
             age        0        0        0        0        0        0        0
             dtf   .04979  -.02801        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(52,152 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,834,777 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        54,989
        from master                    51,399  (_merge==1)
        from using                      3,590  (_merge==2)

    matched                             5,318  (_merge==3)
    -----------------------------------------
(4,482 observations deleted)
(4,426 observations deleted)
vuosi on 1997

Matching Summary:
-----------------
Number of strata: 1268
Number of matched strata: 247

               0      1
      All  28399  23000
  Matched    695    695
Unmatched  27704  22305


Multivariate L1 distance: .27194245

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_1997        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04748  -.01727        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(50,009 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,832,022 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        57,826
        from master                    53,500  (_merge==1)
        from using                      4,326  (_merge==2)

    matched                             5,972  (_merge==3)
    -----------------------------------------
(5,192 observations deleted)
(5,106 observations deleted)
vuosi on 1998

Matching Summary:
-----------------
Number of strata: 1287
Number of matched strata: 313

               0      1
      All  28297  25203
  Matched   1249   1249
Unmatched  27048  23954


Multivariate L1 distance: .25860689

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_1998        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04484  -.11449        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(51,002 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,836,920 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        53,236
        from master                    47,507  (_merge==1)
        from using                      5,729  (_merge==2)

    matched                             7,067  (_merge==3)
    -----------------------------------------
(6,519 observations deleted)
(6,277 observations deleted)
vuosi on 1999

Matching Summary:
-----------------
Number of strata: 1281
Number of matched strata: 311

               0      1
      All  27690  19817
  Matched    857    857
Unmatched  26833  18960


Multivariate L1 distance: .29288215

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1999       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .03851  .04901       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(45,793 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,805,776 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        87,544
        from master                    79,376  (_merge==1)
        from using                      8,168  (_merge==2)

    matched                             6,342  (_merge==3)
    -----------------------------------------
(7,224 observations deleted)
(7,286 observations deleted)
vuosi on 2000

Matching Summary:
-----------------
Number of strata: 1345
Number of matched strata: 435

               0      1
      All  39864  39512
  Matched   2357   2357
Unmatched  37507  37155


Multivariate L1 distance: .24013577

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2000        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04412  -.01782        0        0       -1       -1        .
         suorv_d        0        0        0        0        0        0        0
(74,662 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,811,090 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        81,596
        from master                    71,388  (_merge==1)
        from using                     10,208  (_merge==2)

    matched                             9,016  (_merge==3)
    -----------------------------------------
(9,419 observations deleted)
(9,805 observations deleted)
vuosi on 2001

Matching Summary:
-----------------
Number of strata: 1334
Number of matched strata: 370

               0      1
      All  35495  35893
  Matched   2095   2095
Unmatched  33400  33798


Multivariate L1 distance: .23102625

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2001       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .03294  .03341       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(67,198 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,812,813 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        80,761
        from master                    68,014  (_merge==1)
        from using                     12,747  (_merge==2)

    matched                            10,667  (_merge==3)
    -----------------------------------------
(11,796 observations deleted)
(11,618 observations deleted)
vuosi on 2002

Matching Summary:
-----------------
Number of strata: 1325
Number of matched strata: 340

               0      1
      All  32849  35165
  Matched   1334   1334
Unmatched  31515  33831


Multivariate L1 distance: .26461769

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2002       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .02924  .02774       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(65,346 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,818,025 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        76,619
        from master                    62,003  (_merge==1)
        from using                     14,616  (_merge==2)

    matched                            11,466  (_merge==3)
    -----------------------------------------
(13,331 observations deleted)
(12,751 observations deleted)
vuosi on 2003

Matching Summary:
-----------------
Number of strata: 1314
Number of matched strata: 308

               0      1
      All  31359  30644
  Matched   1029   1029
Unmatched  30330  29615


Multivariate L1 distance: .28571429

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2003        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .05151  -.00972        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(59,945 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,799,217 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       100,281
        from master                    82,209  (_merge==1)
        from using                     18,072  (_merge==2)

    matched                            10,068  (_merge==3)
    -----------------------------------------
(14,094 observations deleted)
(14,046 observations deleted)
vuosi on 2004

Matching Summary:
-----------------
Number of strata: 1375
Number of matched strata: 465

               0      1
      All  42984  39225
  Matched   2486   2486
Unmatched  40498  36739


Multivariate L1 distance: .23290426

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2004       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .02936  -.0539       0       0       0      -1       .
         suorv_d       0       0       0       0       0       0       0
(77,237 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,797,937 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       105,515
        from master                    82,980  (_merge==1)
        from using                     22,535  (_merge==2)

    matched                            10,577  (_merge==3)
    -----------------------------------------
(16,936 observations deleted)
(16,176 observations deleted)
vuosi on 2005

Matching Summary:
-----------------
Number of strata: 1378
Number of matched strata: 462

               0      1
      All  46834  36146
  Matched   4919   4919
Unmatched  41915  31227


Multivariate L1 distance: .20573287

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2005        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf    .0492  -.06282        0        0        0       -1        .
         suorv_d        0        0        0        0        0        0        0
(73,142 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,795,247 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       107,077
        from master                    80,187  (_merge==1)
        from using                     26,890  (_merge==2)

    matched                            16,060  (_merge==3)
    -----------------------------------------
(21,822 observations deleted)
(21,128 observations deleted)
vuosi on 2006

Matching Summary:
-----------------
Number of strata: 1377
Number of matched strata: 408

               0      1
      All  43890  36297
  Matched   2604   2604
Unmatched  41286  33693


Multivariate L1 distance: .24039939

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2006        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .03994  -.10253        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(74,979 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,796,263 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       111,219
        from master                    79,146  (_merge==1)
        from using                     32,073  (_merge==2)

    matched                            16,085  (_merge==3)
    -----------------------------------------
(24,543 observations deleted)
(23,615 observations deleted)
vuosi on 2007

Matching Summary:
-----------------
Number of strata: 1323
Number of matched strata: 412

               0      1
      All  44919  34227
  Matched   2287   2287
Unmatched  42632  31940


Multivariate L1 distance: .24573677

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2007       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .06078  .00918       0       1       0       0       .
         suorv_d       0       0       0       0       0       0       0
(74,572 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,787,714 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       119,294
        from master                    85,171  (_merge==1)
        from using                     34,123  (_merge==2)

    matched                            18,609  (_merge==3)
    -----------------------------------------
(26,795 observations deleted)
(25,937 observations deleted)
vuosi on 2008

Matching Summary:
-----------------
Number of strata: 1333
Number of matched strata: 428

               0      1
      All  45542  39629
  Matched   2782   2782
Unmatched  42760  36847


Multivariate L1 distance: .22897196

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2008        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf    .0514  -.08339        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(79,607 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,794,305 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       117,805
        from master                    78,349  (_merge==1)
        from using                     39,456  (_merge==2)

    matched                            18,840  (_merge==3)
    -----------------------------------------
(29,529 observations deleted)
(28,767 observations deleted)
vuosi on 2009

Matching Summary:
-----------------
Number of strata: 1307
Number of matched strata: 434

               0      1
      All  42720  35629
  Matched   2243   2243
Unmatched  40477  33386


Multivariate L1 distance: .23673651

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2009        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04547  -.02095        0        0        0       -1        .
         suorv_d        0        0        0        0        0        0        0
(73,863 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(1,056,686 real changes made)
(771,005 real changes made)
(46,787,756 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       125,350
        from master                    83,153  (_merge==1)
        from using                     42,197  (_merge==2)

    matched                            20,585  (_merge==3)
    -----------------------------------------
(31,908 observations deleted)
(30,874 observations deleted)
vuosi on 2010

Matching Summary:
-----------------
Number of strata: 1380
Number of matched strata: 459

               0      1
      All  48498  34655
  Matched   3053   3053
Unmatched  45445  31602


Multivariate L1 distance: .22961022

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2010       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .05044  .02031       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(77,047 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_srG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,853,330 observations deleted)
vuosi on 1994

Matching Summary:
-----------------
Number of strata: 928
Number of matched strata: 253

               0      1
      All  25090  13074
  Matched   1530   1530
Unmatched  23560  11544


Multivariate L1 distance: .17189542

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1994       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .02614  .03268       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(35,104 observations deleted)
(note: file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta not found)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,849,417 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        40,913
        from master                    39,965  (_merge==1)
        from using                        948  (_merge==2)

    matched                             2,112  (_merge==3)
    -----------------------------------------
(1,550 observations deleted)
(1,510 observations deleted)
vuosi on 1995

Matching Summary:
-----------------
Number of strata: 944
Number of matched strata: 225

               0      1
      All  26640  13325
  Matched    943    943
Unmatched  25697  12382


Multivariate L1 distance: .18027572

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1995       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .05938   .0403       0       0       1       .       .
         suorv_d       0       0       0       0       0       0       0
(38,079 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,849,949 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        39,793
        from master                    38,196  (_merge==1)
        from using                      1,597  (_merge==2)

    matched                             3,349  (_merge==3)
    -----------------------------------------
(2,471 observations deleted)
(2,475 observations deleted)
vuosi on 1996

Matching Summary:
-----------------
Number of strata: 1171
Number of matched strata: 207

               0      1
      All  23542  14654
  Matched    924    924
Unmatched  22618  13730


Multivariate L1 distance: .21645022

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1996       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       .
             age       0       0       0       0       0       0       0
             dtf  .06818  .15693       0       0       0       2       .
         suorv_d       0       0       0       0       0       0       0
(36,348 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,851,864 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        38,094
        from master                    35,465  (_merge==1)
        from using                      2,629  (_merge==2)

    matched                             4,165  (_merge==3)
    -----------------------------------------
(3,475 observations deleted)
(3,319 observations deleted)
vuosi on 1997

Matching Summary:
-----------------
Number of strata: 969
Number of matched strata: 189

               0      1
      All  22720  12745
  Matched    738    738
Unmatched  21982  12007


Multivariate L1 distance: .19783198

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1997       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04743  .03523       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(33,989 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,850,560 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        39,554
        from master                    36,109  (_merge==1)
        from using                      3,445  (_merge==2)

    matched                             4,825  (_merge==3)
    -----------------------------------------
(4,255 observations deleted)
(4,015 observations deleted)
vuosi on 1998

Matching Summary:
-----------------
Number of strata: 989
Number of matched strata: 192

               0      1
      All  22712  13397
  Matched   1151   1151
Unmatched  21561  12246


Multivariate L1 distance: .20156386

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1998       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf    .053  .11816       0       1       0       .       .
         suorv_d       0       0       0       0       0       0       0
(33,807 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,853,399 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        37,269
        from master                    32,396  (_merge==1)
        from using                      4,873  (_merge==2)

    matched                             5,699  (_merge==3)
    -----------------------------------------
(5,516 observations deleted)
(5,056 observations deleted)
vuosi on 1999

Matching Summary:
-----------------
Number of strata: 974
Number of matched strata: 217

               0      1
      All  21052  11344
  Matched    845    845
Unmatched  20207  10499


Multivariate L1 distance: .2591716

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1999       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .06154  .10888       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(30,706 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,842,635 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        52,101
        from master                    44,349  (_merge==1)
        from using                      7,752  (_merge==2)

    matched                             4,510  (_merge==3)
    -----------------------------------------
(6,189 observations deleted)
(6,073 observations deleted)
vuosi on 2000

Matching Summary:
-----------------
Number of strata: 1060
Number of matched strata: 308

               0      1
      All  25281  19068
  Matched   1541   1541
Unmatched  23740  17527


Multivariate L1 distance: .24334848

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2000       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04997  .10902       0       0       0       1       .
         suorv_d       0       0       0       0       0       0       0
(41,267 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,845,495 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        49,105
        from master                    39,880  (_merge==1)
        from using                      9,225  (_merge==2)

    matched                             6,119  (_merge==3)
    -----------------------------------------
(7,348 observations deleted)
(7,996 observations deleted)
vuosi on 2001

Matching Summary:
-----------------
Number of strata: 1057
Number of matched strata: 233

               0      1
      All  22470  17410
  Matched   1012   1012
Unmatched  21458  16398


Multivariate L1 distance: .24209486

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2001       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .08103  .01285       0       1      -1       0       .
         suorv_d       0       0       0       0       0       0       0
(37,856 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,847,214 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        47,676
        from master                    37,294  (_merge==1)
        from using                     10,382  (_merge==2)

    matched                             6,986  (_merge==3)
    -----------------------------------------
(8,882 observations deleted)
(8,486 observations deleted)
vuosi on 2002

Matching Summary:
-----------------
Number of strata: 1065
Number of matched strata: 218

               0      1
      All  21156  16138
  Matched    919    919
Unmatched  20237  15219


Multivariate L1 distance: .25244831

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2002       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04135  .09902       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(35,456 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,850,080 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        45,448
        from master                    33,828  (_merge==1)
        from using                     11,620  (_merge==2)

    matched                             7,586  (_merge==3)
    -----------------------------------------
(9,850 observations deleted)
(9,356 observations deleted)
vuosi on 2003

Matching Summary:
-----------------
Number of strata: 1045
Number of matched strata: 205

               0      1
      All  20159  13669
  Matched    769    769
Unmatched  19390  12900


Multivariate L1 distance: .22886866

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2003       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .05722  -.0052       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(32,290 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,839,712 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        60,852
        from master                    45,945  (_merge==1)
        from using                     14,907  (_merge==2)

    matched                             5,837  (_merge==3)
    -----------------------------------------
(10,247 observations deleted)
(10,497 observations deleted)
vuosi on 2004

Matching Summary:
-----------------
Number of strata: 1117
Number of matched strata: 280

               0      1
      All  23587  22358
  Matched   1855   1855
Unmatched  21732  20503


Multivariate L1 distance: .2328841

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2004        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .05121  -.13747        0        0        0       -1        .
         suorv_d        0        0        0        0        0        0        0
(42,235 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,845,723 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        58,529
        from master                    39,923  (_merge==1)
        from using                     18,606  (_merge==2)

    matched                             5,848  (_merge==3)
    -----------------------------------------
(12,311 observations deleted)
(12,143 observations deleted)
vuosi on 2005

Matching Summary:
-----------------
Number of strata: 1080
Number of matched strata: 248

               0      1
      All  23655  16268
  Matched   1428   1428
Unmatched  22227  14840


Multivariate L1 distance: .20238095

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2005       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04972  .05602       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(37,067 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,844,431 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        60,203
        from master                    39,978  (_merge==1)
        from using                     20,225  (_merge==2)

    matched                             7,085  (_merge==3)
    -----------------------------------------
(13,833 observations deleted)
(13,477 observations deleted)
vuosi on 2006

Matching Summary:
-----------------
Number of strata: 1090
Number of matched strata: 245

               0      1
      All  22650  17328
  Matched   1162   1162
Unmatched  21488  16166


Multivariate L1 distance: .23924269

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2006        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .06196  -.14372        0       -1        1       -1        .
         suorv_d        0        0        0        0        0        0        0
(37,654 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,842,928 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        62,856
        from master                    40,894  (_merge==1)
        from using                     21,962  (_merge==2)

    matched                             7,672  (_merge==3)
    -----------------------------------------
(14,778 observations deleted)
(14,856 observations deleted)
vuosi on 2007

Matching Summary:
-----------------
Number of strata: 1106
Number of matched strata: 264

               0      1
      All  23258  17636
  Matched   1118   1118
Unmatched  22140  16518


Multivariate L1 distance: .23076923

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2007        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .05277  -.17621        0        0        0       -1        .
         suorv_d        0        0        0        0        0        0        0
(38,658 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,841,008 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        66,030
        from master                    42,323  (_merge==1)
        from using                     23,707  (_merge==2)

    matched                             8,163  (_merge==3)
    -----------------------------------------
(15,937 observations deleted)
(15,933 observations deleted)
vuosi on 2008

Matching Summary:
-----------------
Number of strata: 1109
Number of matched strata: 312

               0      1
      All  22842  19481
  Matched   1522   1522
Unmatched  21320  17959


Multivariate L1 distance: .22733246

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2008        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04599  -.17148        0       -1        0       -1        .
         suorv_d        0        0        0        0        0        0        0
(39,279 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,844,528 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        64,842
        from master                    38,447  (_merge==1)
        from using                     26,395  (_merge==2)

    matched                             8,519  (_merge==3)
    -----------------------------------------
(17,510 observations deleted)
(17,404 observations deleted)
vuosi on 2009

Matching Summary:
-----------------
Number of strata: 1091
Number of matched strata: 244

               0      1
      All  21426  17021
  Matched    866    866
Unmatched  20560  16155


Multivariate L1 distance: .22286374

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2009        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04503  -.11201        0        0        0       -1        .
         suorv_d        0        0        0        0        0        0        0
(36,715 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(611,064 real changes made)
(371,977 real changes made)
(46,876,136 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        46,652
        from master                    12,682  (_merge==1)
        from using                     33,970  (_merge==2)

    matched                             2,676  (_merge==3)
    -----------------------------------------
(18,468 observations deleted)
(18,178 observations deleted)
vuosi on 2010

Matching Summary:
-----------------
Number of strata: 828
Number of matched strata: 124

               0      1
      All  11393   1289
  Matched    276    276
Unmatched  11117   1013


Multivariate L1 distance: .17753623

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2010       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .06522  .22101       0      -1       0       1       .
         suorv_d       0       0       0       0       0       0       0
(12,130 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_mngt_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,841,462 observations deleted)
vuosi on 1994

Matching Summary:
-----------------
Number of strata: 960
Number of matched strata: 223

               0      1
      All  42090   7942
  Matched   1326   1326
Unmatched  40764   6616


Multivariate L1 distance: .21191554

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1994       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .03544  .00302       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(47,380 observations deleted)
(note: file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta not found)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,831,889 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        58,519
        from master                    57,736  (_merge==1)
        from using                        783  (_merge==2)

    matched                             1,869  (_merge==3)
    -----------------------------------------
(1,353 observations deleted)
(1,299 observations deleted)
vuosi on 1995

Matching Summary:
-----------------
Number of strata: 986
Number of matched strata: 218

               0      1
      All  47786   9950
  Matched   1165   1165
Unmatched  46621   8785


Multivariate L1 distance: .20171674

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1995       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf   .0412  .14335       0       1       0       .       .
         suorv_d       0       0       0       0       0       0       0
(55,406 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,834,293 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        55,805
        from master                    54,012  (_merge==1)
        from using                      1,793  (_merge==2)

    matched                             3,189  (_merge==3)
    -----------------------------------------
(2,557 observations deleted)
(2,425 observations deleted)
vuosi on 1996

Matching Summary:
-----------------
Number of strata: 1224
Number of matched strata: 206

               0      1
      All  42355  11657
  Matched   1038   1038
Unmatched  41317  10619


Multivariate L1 distance: .22157996

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1996       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       .
             age       0       0       0       0       0       0       0
             dtf  .08863  .30347       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(51,936 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,837,283 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        52,377
        from master                    49,765  (_merge==1)
        from using                      2,612  (_merge==2)

    matched                             4,446  (_merge==3)
    -----------------------------------------
(3,685 observations deleted)
(3,373 observations deleted)
vuosi on 1997

Matching Summary:
-----------------
Number of strata: 1028
Number of matched strata: 215

               0      1
      All  41552   8213
  Matched    941    941
Unmatched  40611   7272


Multivariate L1 distance: .20935175

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1997       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04676  .00956       0      -1       0       .       .
         suorv_d       0       0       0       0       0       0       0
(47,883 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,835,536 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        54,306
        from master                    50,662  (_merge==1)
        from using                      3,644  (_merge==2)

    matched                             5,296  (_merge==3)
    -----------------------------------------
(4,713 observations deleted)
(4,227 observations deleted)
vuosi on 1998

Matching Summary:
-----------------
Number of strata: 1046
Number of matched strata: 220

               0      1
      All  41257   9405
  Matched    985    985
Unmatched  40272   8420


Multivariate L1 distance: .2284264

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_1998        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04975  -.09442        0        0        0       -1        .
         suorv_d        0        0        0        0        0        0        0
(48,692 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,836,974 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        53,422
        from master                    48,516  (_merge==1)
        from using                      4,906  (_merge==2)

    matched                             6,004  (_merge==3)
    -----------------------------------------
(5,822 observations deleted)
(5,088 observations deleted)
vuosi on 1999

Matching Summary:
-----------------
Number of strata: 1055
Number of matched strata: 216

               0      1
      All  41031   7485
  Matched    635    635
Unmatched  40396   6850


Multivariate L1 distance: .24566929

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1999       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04409  -.0126       0       1       0      -1       .
         suorv_d       0       0       0       0       0       0       0
(47,246 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,803,780 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        90,276
        from master                    82,905  (_merge==1)
        from using                      7,371  (_merge==2)

    matched                             4,809  (_merge==3)
    -----------------------------------------
(6,255 observations deleted)
(5,925 observations deleted)
vuosi on 2000

Matching Summary:
-----------------
Number of strata: 1149
Number of matched strata: 324

               0      1
      All  64294  18611
  Matched   2516   2516
Unmatched  61778  16095


Multivariate L1 distance: .18720191

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2000       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04054  .01709       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(77,873 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,811,717 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        81,159
        from master                    71,862  (_merge==1)
        from using                      9,297  (_merge==2)

    matched                             7,915  (_merge==3)
    -----------------------------------------
(8,892 observations deleted)
(8,320 observations deleted)
vuosi on 2001

Matching Summary:
-----------------
Number of strata: 1154
Number of matched strata: 272

               0      1
      All  56200  15662
  Matched   1425   1425
Unmatched  54775  14237


Multivariate L1 distance: .20070175

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2001       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .02456  .01825       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(69,012 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,814,721 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        78,587
        from master                    67,649  (_merge==1)
        from using                     10,938  (_merge==2)

    matched                             9,124  (_merge==3)
    -----------------------------------------
(10,621 observations deleted)
(9,441 observations deleted)
vuosi on 2002

Matching Summary:
-----------------
Number of strata: 1125
Number of matched strata: 228

               0      1
      All  53677  13972
  Matched   1027   1027
Unmatched  52650  12945


Multivariate L1 distance: .22687439

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2002       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04479  .00974       0       0       0      -1       .
         suorv_d       0       0       0       0       0       0       0
(65,595 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,817,231 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        77,273
        from master                    64,710  (_merge==1)
        from using                     12,563  (_merge==2)

    matched                             9,553  (_merge==3)
    -----------------------------------------
(11,889 observations deleted)
(10,227 observations deleted)
vuosi on 2003

Matching Summary:
-----------------
Number of strata: 1145
Number of matched strata: 226

               0      1
      All  52146  12564
  Matched    849    849
Unmatched  51297  11715


Multivariate L1 distance: .26030624

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2003        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .05065  -.02473        0        0        0        0        .
         suorv_d        0        0        0        0        0        0        0
(63,012 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,802,712 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        97,022
        from master                    80,995  (_merge==1)
        from using                     16,027  (_merge==2)

    matched                             7,787  (_merge==3)
    -----------------------------------------
(12,445 observations deleted)
(11,369 observations deleted)
vuosi on 2004

Matching Summary:
-----------------
Number of strata: 1164
Number of matched strata: 325

               0      1
      All  65458  15537
  Matched   2099   2099
Unmatched  63359  13438


Multivariate L1 distance: .22010481

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2004        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04288  -.02239        0        0       -1        0        .
         suorv_d        0        0        0        0        0        0        0
(76,797 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,802,255 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                        99,469
        from master                    80,348  (_merge==1)
        from using                     19,121  (_merge==2)

    matched                             8,891  (_merge==3)
    -----------------------------------------
(14,694 observations deleted)
(13,318 observations deleted)
vuosi on 2005

Matching Summary:
-----------------
Number of strata: 1129
Number of matched strata: 309

               0      1
      All  68455  11893
  Matched   2430   2430
Unmatched  66025   9463


Multivariate L1 distance: .20781893

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2005       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .05226  .07284       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(75,488 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,799,935 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       102,255
        from master                    80,471  (_merge==1)
        from using                     21,784  (_merge==2)

    matched                            11,088  (_merge==3)
    -----------------------------------------
(17,117 observations deleted)
(15,755 observations deleted)
vuosi on 2006

Matching Summary:
-----------------
Number of strata: 1158
Number of matched strata: 305

               0      1
      All  68513  11958
  Matched   1747   1747
Unmatched  66766  10211


Multivariate L1 distance: .22152261

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2006       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04121  .07384       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(76,977 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,796,730 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       107,712
        from master                    83,055  (_merge==1)
        from using                     24,657  (_merge==2)

    matched                            11,709  (_merge==3)
    -----------------------------------------
(18,878 observations deleted)
(17,488 observations deleted)
vuosi on 2007

Matching Summary:
-----------------
Number of strata: 1150
Number of matched strata: 324

               0      1
      All  70349  12706
  Matched   1888   1888
Unmatched  68461  10818


Multivariate L1 distance: .20497881

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2007        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .03284  -.03231        0        0        0       -1        .
         suorv_d        0        0        0        0        0        0        0
(79,279 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,792,453 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       112,631
        from master                    85,765  (_merge==1)
        from using                     26,866  (_merge==2)

    matched                            13,276  (_merge==3)
    -----------------------------------------
(20,943 observations deleted)
(19,199 observations deleted)
vuosi on 2008

Matching Summary:
-----------------
Number of strata: 1152
Number of matched strata: 311

               0      1
      All  71600  14165
  Matched   2076   2076
Unmatched  69524  12089


Multivariate L1 distance: .20375723

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2008       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .06744  .11609       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(81,613 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,795,736 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       113,108
        from master                    82,286  (_merge==1)
        from using                     30,822  (_merge==2)

    matched                            13,472  (_merge==3)
    -----------------------------------------
(23,161 observations deleted)
(21,133 observations deleted)
vuosi on 2009

Matching Summary:
-----------------
Number of strata: 1159
Number of matched strata: 300

               0      1
      All  69742  12544
  Matched   1676   1676
Unmatched  68066  10868


Multivariate L1 distance: .20942721

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2009       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04057  .04594       0       1       0       0       .
         suorv_d       0       0       0       0       0       0       0
(78,934 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(1,544,611 real changes made)
(348,702 real changes made)
(46,757,036 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       151,994
        from master                   119,403  (_merge==1)
        from using                     32,591  (_merge==2)

    matched                            15,055  (_merge==3)
    -----------------------------------------
(25,098 observations deleted)
(22,548 observations deleted)
vuosi on 2010

Matching Summary:
-----------------
Number of strata: 1287
Number of matched strata: 430

               0      1
      All  93887  25516
  Matched   4102   4102
Unmatched  89785  21414


Multivariate L1 distance: .19307655

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2010       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04291  .18649       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(111,199 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_jrG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,710,374 observations deleted)
vuosi on 1994

Matching Summary:
-----------------
Number of strata: 1360
Number of matched strata: 391

                0       1
      All  134221   46899
  Matched    5920    5920
Unmatched  128301   40979


Multivariate L1 distance: .12635135

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_1994        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .02584  -.00693        0        0        .        .        .
         suorv_d        0        0        0        0        0        0        0
(169,280 observations deleted)
(note: file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta not found)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,669,025 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       217,647
        from master                   214,138  (_merge==1)
        from using                      3,509  (_merge==2)

    matched                             8,331  (_merge==3)
    -----------------------------------------
(5,988 observations deleted)
(5,852 observations deleted)
vuosi on 1995

Matching Summary:
-----------------
Number of strata: 1396
Number of matched strata: 369

                0       1
      All  163195   50943
  Matched    4467    4467
Unmatched  158728   46476


Multivariate L1 distance: .13633311

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1995       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf   .0291  .00716       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(205,204 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,678,617 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       207,273
        from master                   199,688  (_merge==1)
        from using                      7,585  (_merge==2)

    matched                            13,189  (_merge==3)
    -----------------------------------------
(10,441 observations deleted)
(10,333 observations deleted)
vuosi on 1996

Matching Summary:
-----------------
Number of strata: 1752
Number of matched strata: 340

                0       1
      All  134898   64790
  Matched    3048    3048
Unmatched  131850   61742


Multivariate L1 distance: .13648294

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_1996        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        .
             age        0        0        0        0        0        0        0
             dtf   .03215  -.04954        0        0        0        .        .
         suorv_d        0        0        0        0        0        0        0
(193,592 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,692,134 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       195,160
        from master                   183,825  (_merge==1)
        from using                     11,335  (_merge==2)

    matched                            15,535  (_merge==3)
    -----------------------------------------
(13,757 observations deleted)
(13,113 observations deleted)
vuosi on 1997

Matching Summary:
-----------------
Number of strata: 1404
Number of matched strata: 333

                0       1
      All  135194   48631
  Matched    2501    2501
Unmatched  132693   46130


Multivariate L1 distance: .16633347

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_1997        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04318  -.04438        0        0        0        .        .
         suorv_d        0        0        0        0        0        0        0
(178,823 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,683,717 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       202,299
        from master                   189,102  (_merge==1)
        from using                     13,197  (_merge==2)

    matched                            18,675  (_merge==3)
    -----------------------------------------
(16,479 observations deleted)
(15,393 observations deleted)
vuosi on 1998

Matching Summary:
-----------------
Number of strata: 1438
Number of matched strata: 359

                0       1
      All  135887   53215
  Matched    3924    3924
Unmatched  131963   49291


Multivariate L1 distance: .1432212

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1998       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .03338  .00408       0       0       1       .       .
         suorv_d       0       0       0       0       0       0       0
(181,254 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,695,170 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       192,288
        from master                   174,446  (_merge==1)
        from using                     17,842  (_merge==2)

    matched                            21,878  (_merge==3)
    -----------------------------------------
(20,748 observations deleted)
(18,972 observations deleted)
vuosi on 1999

Matching Summary:
-----------------
Number of strata: 1415
Number of matched strata: 362

                0       1
      All  133113   41333
  Matched    3010    3010
Unmatched  130103   38323


Multivariate L1 distance: .15282392

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_1999       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .03289  .00033       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(168,426 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,580,526 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       312,900
        from master                   289,064  (_merge==1)
        from using                     23,836  (_merge==2)

    matched                            21,904  (_merge==3)
    -----------------------------------------
(23,771 observations deleted)
(21,969 observations deleted)
vuosi on 2000

Matching Summary:
-----------------
Number of strata: 1532
Number of matched strata: 503

                0       1
      All  213546   75518
  Matched    5639    5639
Unmatched  207907   69879


Multivariate L1 distance: .14399716

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2000       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .02128  .01099       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(277,786 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,616,088 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       279,168
        from master                   248,778  (_merge==1)
        from using                     30,390  (_merge==2)

    matched                            26,628  (_merge==3)
    -----------------------------------------
(28,837 observations deleted)
(28,181 observations deleted)
vuosi on 2001

Matching Summary:
-----------------
Number of strata: 1526
Number of matched strata: 426

                0       1
      All  181932   66846
  Matched    3932    3932
Unmatched  178000   62914


Multivariate L1 distance: .16149542

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2001       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .02848  .01653       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(240,914 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,626,795 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       271,465
        from master                   235,641  (_merge==1)
        from using                     35,824  (_merge==2)

    matched                            29,058  (_merge==3)
    -----------------------------------------
(34,043 observations deleted)
(30,839 observations deleted)
vuosi on 2002

Matching Summary:
-----------------
Number of strata: 1511
Number of matched strata: 429

                0       1
      All  173144   62497
  Matched    3990    3990
Unmatched  169154   58507


Multivariate L1 distance: .16691729

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2002       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .02832  .00276       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(227,661 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,638,207 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       263,169
        from master                   221,797  (_merge==1)
        from using                     41,372  (_merge==2)

    matched                            31,490  (_merge==3)
    -----------------------------------------
(38,465 observations deleted)
(34,397 observations deleted)
vuosi on 2003

Matching Summary:
-----------------
Number of strata: 1536
Number of matched strata: 368

                0       1
      All  170014   51783
  Matched    3434    3434
Unmatched  166580   48349


Multivariate L1 distance: .15870705

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2003       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf   .0332  .13075       0       0       1       .       .
         suorv_d       0       0       0       0       0       0       0
(214,929 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,576,995 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       328,199
        from master                   281,484  (_merge==1)
        from using                     46,715  (_merge==2)

    matched                            33,015  (_merge==3)
    -----------------------------------------
(41,174 observations deleted)
(38,556 observations deleted)
vuosi on 2004

Matching Summary:
-----------------
Number of strata: 1558
Number of matched strata: 446

                0       1
      All  215259   66225
  Matched    3740    3740
Unmatched  211519   62485


Multivariate L1 distance: .17165775

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2004       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .03048  .05107       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(274,004 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,588,319 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       324,623
        from master                   270,294  (_merge==1)
        from using                     54,329  (_merge==2)

    matched                            32,881  (_merge==3)
    -----------------------------------------
(46,262 observations deleted)
(40,948 observations deleted)
vuosi on 2005

Matching Summary:
-----------------
Number of strata: 1545
Number of matched strata: 448

                0       1
      All  225663   44631
  Matched    4482    4482
Unmatched  221181   40149


Multivariate L1 distance: .1671129

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2005       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf    .027  .06002       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(261,330 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,564,670 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       348,566
        from master                   289,608  (_merge==1)
        from using                     58,958  (_merge==2)

    matched                            37,216  (_merge==3)
    -----------------------------------------
(51,213 observations deleted)
(44,961 observations deleted)
vuosi on 2006

Matching Summary:
-----------------
Number of strata: 1573
Number of matched strata: 448

                0       1
      All  235201   54407
  Matched    3377    3377
Unmatched  231824   51030


Multivariate L1 distance: .19692034

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2006       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04294  .05686       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(282,854 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,557,966 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       355,582
        from master                   293,091  (_merge==1)
        from using                     62,491  (_merge==2)

    matched                            40,437  (_merge==3)
    -----------------------------------------
(54,759 observations deleted)
(48,169 observations deleted)
vuosi on 2007

Matching Summary:
-----------------
Number of strata: 1569
Number of matched strata: 476

                0       1
      All  242693   50398
  Matched    4554    4554
Unmatched  238139   45844


Multivariate L1 distance: .16622749

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2007       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04743  .06324       0       0       0       .       .
         suorv_d       0       0       0       0       0       0       0
(283,983 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,553,963 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       364,505
        from master                   295,000  (_merge==1)
        from using                     69,505  (_merge==2)

    matched                            42,531  (_merge==3)
    -----------------------------------------
(59,259 observations deleted)
(52,777 observations deleted)
vuosi on 2008

Matching Summary:
-----------------
Number of strata: 1576
Number of matched strata: 513

                0       1
      All  234286   60714
  Matched    5066    5066
Unmatched  229220   55648


Multivariate L1 distance: .15021713

Univariate imbalance:

                       L1     mean      min      25%      50%      75%      max
             msc        0        0        0        0        0        0        0
     edu_science        0        0        0        0        0        0        0
           manuf        0        0        0        0        0        0        0
firm_size_q_2008        0        0        0        0        0        0        0
    region_large        0        0        0        0        0        0        0
             age        0        0        0        0        0        0        0
             dtf   .04106  -.02152        0        1        0        .        .
         suorv_d        0        0        0        0        0        0        0
(284,868 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,578,006 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       347,954
        from master                   269,637  (_merge==1)
        from using                     78,317  (_merge==2)

    matched                            43,851  (_merge==3)
    -----------------------------------------
(64,166 observations deleted)
(58,002 observations deleted)
vuosi on 2009

Matching Summary:
-----------------
Number of strata: 1555
Number of matched strata: 469

                0       1
      All  215230   54407
  Matched    3157    3157
Unmatched  212073   51250


Multivariate L1 distance: .18276845

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2009       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .04308  .08014       0       0      -1       0       .
         suorv_d       0       0       0       0       0       0       0
(263,323 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved
(0 real changes made)
(4,844,493 real changes made)
(1,459,314 real changes made)
(46,578,889 observations deleted)

    Result                           # of obs.
    -----------------------------------------
    not matched                       352,745
        from master                   268,434  (_merge==1)
        from using                     84,311  (_merge==2)

    matched                            44,171  (_merge==3)
    -----------------------------------------
(68,820 observations deleted)
(59,662 observations deleted)
vuosi on 2010

Matching Summary:
-----------------
Number of strata: 1555
Number of matched strata: 526

                0       1
      All  227688   40746
  Matched    3751    3751
Unmatched  223937   36995


Multivariate L1 distance: .17701946

Univariate imbalance:

                      L1    mean     min     25%     50%     75%     max
             msc       0       0       0       0       0       0       0
     edu_science       0       0       0       0       0       0       0
           manuf       0       0       0       0       0       0       0
firm_size_q_2010       0       0       0       0       0       0       0
    region_large       0       0       0       0       0       0       0
             age       0       0       0       0       0       0       0
             dtf  .03093  .05625       0       0       0       0       .
         suorv_d       0       0       0       0       0       0       0
(260,932 observations deleted)
file W:\returns\estimation_data\returns_EST_tempsose_bcG.dta saved

. restore 

. 
. *use "${data}\returns_DATAPREP_temp.dta", clear
. drop treated_cow

. foreach j of global sose_types {
  2.         preserve
  3.         merge 1:1 shnro vuosi using "${work}\returns_EST_temp`j'G.dta"
  4. 
.         * keeping all obs of matched individuals
.         bysort shnro: egen cem_sample   = max(cem_matched)
  5. 
.         keep if cem_sample == 1 
  6. 
.         save "${work}\returns_EST_`j'G.dta", replace
  7.         erase "${work}\returns_EST_temp`j'G.dta"
  8. 
.         restore
  9.         }

    Result                           # of obs.
    -----------------------------------------
    not matched                    46,869,096
        from master                46,869,096  (_merge==1)
        from using                          0  (_merge==2)

    matched                            22,398  (_merge==3)
    -----------------------------------------
(46349726 missing values generated)
(46,349,726 observations deleted)
file W:\returns\estimation_data\returns_EST_sose_mngt_srG.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                    46,822,606
        from master                46,822,606  (_merge==1)
        from using                          0  (_merge==2)

    matched                            68,888  (_merge==3)
    -----------------------------------------
(45282731 missing values generated)
(45,282,731 observations deleted)
file W:\returns\estimation_data\returns_EST_sose_srG.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                    46,854,296
        from master                46,854,296  (_merge==1)
        from using                          0  (_merge==2)

    matched                            37,198  (_merge==3)
    -----------------------------------------
(46005536 missing values generated)
(46,005,536 observations deleted)
file W:\returns\estimation_data\returns_EST_sose_mngt_jrG.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                    46,835,644
        from master                46,835,644  (_merge==1)
        from using                          0  (_merge==2)

    matched                            55,850  (_merge==3)
    -----------------------------------------
(45626907 missing values generated)
(45,626,907 observations deleted)
file W:\returns\estimation_data\returns_EST_sose_jrG.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                    46,755,510
        from master                46,755,510  (_merge==1)
        from using                          0  (_merge==2)

    matched                           135,984  (_merge==3)
    -----------------------------------------
(43825736 missing values generated)
(43,825,736 observations deleted)
file W:\returns\estimation_data\returns_EST_sose_bcG.dta saved

. 
. **********************************************
. /*
> 
> NOTE: the CEM command written by Blackwell, Iacus, Porro and King 
> cem: Coarsened exact matching in Stata
> Stata Jornal 2009, 9, 4, 524-546
> does not reproduce data 1:1 if rerun when using the k2k option as we have.
> To replicate our results 1:1 request permission email
> otto.toivanen@aalto.fi and/or ari.hyytinen@hanken.fi to 
> get access to our estimation data
> 
> */      
. **********************************************
. 
. *log close
. 
. exit

end of do-file

. 
. log close
      name:  <unnamed>
       log:  O:\returns\returns_REStat_replication_data_23082022.log
  log type:  text
 closed on:  24 Aug 2022, 08:17:18
-------------------------------------------------------------------------------------------------------------------------
